source: LMDZ6/branches/Amaury_dev/libf/phydev/phyetat0.F90 @ 5144

Last change on this file since 5144 was 5117, checked in by abarral, 4 months ago

rename modules properly lmdz_*
move some unused files to obsolete/
(lint) uppercase fortran keywords

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
File size: 2.3 KB
Line 
1
2! $Id $
3
4SUBROUTINE phyetat0(fichnom)
5! Load initial state for the physics
6! and do some resulting initializations
7
8  USE dimphy, ONLY: klon
9  USE iostart, ONLY: open_startphy,get_field,close_startphy
10  USE iophy, ONLY: init_iophy_new
11  USE lmdz_geometry, ONLY: longitude_deg, latitude_deg
12  USE lmdz_abort_physic, ONLY: abort_physic
13
14  IMPLICIT NONE
15
16  CHARACTER(len=*),INTENT(IN) :: fichnom ! input file name
17
18  REAL :: lon_startphy(klon), lat_startphy(klon)
19  INTEGER :: i
20
21  ! open physics initial state file:
22  CALL open_startphy(fichnom)
23
24  ! read latitudes and make a sanity check (because already known from dyn)
25  CALL get_field("latitude",lat_startphy)
26  DO i=1,klon
27    IF (ABS(lat_startphy(i)-latitude_deg(i))>=1) THEN
28      WRITE(*,*) "phyetat0: Error! Latitude discrepancy wrt startphy file:",&
29                 " i=",i," lat_startphy(i)=",lat_startphy(i),&
30                 " latitude_deg(i)=",latitude_deg(i)
31      ! This is presumably serious enough to abort run
32      CALL abort_physic("phyetat0","discrepancy in latitudes!",1)
33    ENDIF
34    IF (ABS(lat_startphy(i)-latitude_deg(i))>=0.0001) THEN
35      WRITE(*,*) "phyetat0: Warning! Latitude discrepancy wrt startphy file:",&
36                 " i=",i," lat_startphy(i)=",lat_startphy(i),&
37                 " latitude_deg(i)=",latitude_deg(i)
38    ENDIF
39  ENDDO
40
41  ! read longitudes and make a sanity check (because already known from dyn)
42  CALL get_field("longitude",lon_startphy)
43  DO i=1,klon
44    IF (ABS(lon_startphy(i)-longitude_deg(i))>=1) THEN
45      WRITE(*,*) "phyetat0: Error! Longitude discrepancy wrt startphy file:",&
46                 " i=",i," lon_startphy(i)=",lon_startphy(i),&
47                 " longitude_deg(i)=",longitude_deg(i)
48      ! This is presumably serious enough to abort run
49      CALL abort_physic("phyetat0","discrepancy in longitudes!",1)
50    ENDIF
51    IF (ABS(lon_startphy(i)-longitude_deg(i))>=0.0001) THEN
52      WRITE(*,*) "phyetat0: Warning! Longitude discrepancy wrt startphy file:",&
53                 " i=",i," lon_startphy(i)=",lon_startphy(i),&
54                 " longitude_deg(i)=",longitude_deg(i)
55    ENDIF
56  ENDDO
57
58  ! read in other variables here ...
59
60  ! close file
61  CALL close_startphy
62
63  ! do some more initializations
64  CALL init_iophy_new(latitude_deg,longitude_deg)
65
66END SUBROUTINE phyetat0
Note: See TracBrowser for help on using the repository browser.