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

Last change on this file since 5327 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
RevLine 
[5099]1
[1686]2! $Id $
[5099]3
[2395]4SUBROUTINE phyetat0(fichnom)
[1686]5! Load initial state for the physics
6! and do some resulting initializations
7
[5116]8  USE dimphy, ONLY: klon
[5101]9  USE iostart, ONLY: open_startphy,get_field,close_startphy
10  USE iophy, ONLY: init_iophy_new
[5112]11  USE lmdz_geometry, ONLY: longitude_deg, latitude_deg
[5111]12  USE lmdz_abort_physic, ONLY: abort_physic
[1686]13
[2395]14  IMPLICIT NONE
[1686]15
[5117]16  CHARACTER(len=*),INTENT(IN) :: fichnom ! input file name
[1686]17
[2395]18  REAL :: lon_startphy(klon), lat_startphy(klon)
19  INTEGER :: i
[1686]20
[2395]21  ! open physics initial state file:
22  CALL open_startphy(fichnom)
[1686]23
[2395]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
[1686]40
[2395]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
[1686]57
[2395]58  ! read in other variables here ...
[1686]59
[2395]60  ! close file
61  CALL close_startphy
[1686]62
[2395]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.