LMDZ
phyetat0.F90
Go to the documentation of this file.
1 !
2 ! $Id $
3 !
4 SUBROUTINE phyetat0(fichnom)
5 ! Load initial state for the physics
6 ! and do some resulting initializations
7 
8  USE dimphy, only: klon
10  USE iophy, ONLY : init_iophy_new
12 
13  IMPLICIT NONE
14 
15  CHARACTER(len=*),INTENT(in) :: fichnom ! input file name
16 
17  REAL :: lon_startphy(klon), lat_startphy(klon)
18  INTEGER :: i
19 
20  ! open physics initial state file:
21  CALL open_startphy(fichnom)
22 
23  ! read latitudes and make a sanity check (because already known from dyn)
24  CALL get_field("latitude",lat_startphy)
25  DO i=1,klon
26  IF (abs(lat_startphy(i)-latitude_deg(i))>=1) THEN
27  WRITE(*,*) "phyetat0: Error! Latitude discrepancy wrt startphy file:",&
28  " i=",i," lat_startphy(i)=",lat_startphy(i),&
29  " latitude_deg(i)=",latitude_deg(i)
30  ! This is presumably serious enough to abort run
31  CALL abort_physic("phyetat0","discrepancy in latitudes!",1)
32  ENDIF
33  IF (abs(lat_startphy(i)-latitude_deg(i))>=0.0001) THEN
34  WRITE(*,*) "phyetat0: Warning! Latitude discrepancy wrt startphy file:",&
35  " i=",i," lat_startphy(i)=",lat_startphy(i),&
36  " latitude_deg(i)=",latitude_deg(i)
37  ENDIF
38  ENDDO
39 
40  ! read longitudes and make a sanity check (because already known from dyn)
41  CALL get_field("longitude",lon_startphy)
42  DO i=1,klon
43  IF (abs(lon_startphy(i)-longitude_deg(i))>=1) THEN
44  WRITE(*,*) "phyetat0: Error! Longitude discrepancy wrt startphy file:",&
45  " i=",i," lon_startphy(i)=",lon_startphy(i),&
46  " longitude_deg(i)=",longitude_deg(i)
47  ! This is presumably serious enough to abort run
48  CALL abort_physic("phyetat0","discrepancy in longitudes!",1)
49  ENDIF
50  IF (abs(lon_startphy(i)-longitude_deg(i))>=0.0001) THEN
51  WRITE(*,*) "phyetat0: Warning! Longitude discrepancy wrt startphy file:",&
52  " i=",i," lon_startphy(i)=",lon_startphy(i),&
53  " longitude_deg(i)=",longitude_deg(i)
54  ENDIF
55  ENDDO
56 
57  ! read in other variables here ...
58 
59  ! close file
60  CALL close_startphy
61 
62  ! do some more initializations
64 
65 END SUBROUTINE phyetat0
real, dimension(:), allocatable, save latitude_deg
subroutine, public open_startphy(filename)
Definition: iostart.F90:32
integer, save klon
Definition: dimphy.F90:3
subroutine, public close_startphy
Definition: iostart.F90:50
real, dimension(:), allocatable, save longitude_deg
subroutine abort_physic(modname, message, ierr)
Definition: abort_physic.F90:3
subroutine phyetat0(fichnom)
Definition: phyetat0.F90:5
subroutine init_iophy_new(rlat, rlon)
Definition: iophy.F90:42
Definition: dimphy.F90:1
Definition: iophy.F90:4