Changeset 2665 for LMDZ5/trunk/libf/dynphy_lonlat/phylmd/ce0l.F90
- Timestamp:
- Oct 12, 2016, 2:53:20 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/libf/dynphy_lonlat/phylmd/ce0l.F90
r2603 r2665 12 12 ! * "masque" can be: 13 13 ! - read from file "o2a.nc" (for coupled runs). 14 ! - read from file "startphy0.nc" (from a previous run). 14 15 ! - created in etat0phys or etat0dyn (for forced runs). 15 16 ! It is then passed to limit_netcdf to ensure consistancy. … … 20 21 USE etat0phys, ONLY: etat0phys_netcdf 21 22 USE limit, ONLY: limit_netcdf 22 USE netcdf, ONLY: NF90_OPEN, NF90_NOWRITE, NF90_CLOSE, NF90_NOERR 23 USE netcdf, ONLY: NF90_OPEN, NF90_NOWRITE, NF90_CLOSE, NF90_NOERR, & 24 NF90_INQUIRE_DIMENSION, NF90_INQ_DIMID, NF90_INQ_VARID, NF90_GET_VAR 23 25 USE infotrac, ONLY: type_trac, infotrac_init 24 26 USE dimphy, ONLY: klon … … 60 62 REAL, ALLOCATABLE :: lat_omask(:,:), dlat_omask(:), ocetmp (:,:) 61 63 REAL :: date, lev(1) 64 65 !--- Local variables for land mask from startphy0 file reading 66 INTEGER :: nid_sta, nid_nph, nid_msk, nphys 67 REAL, ALLOCATABLE :: masktmp(:) 68 62 69 #ifndef CPP_PARA 63 70 ! for iniphysiq in serial mode … … 133 140 ENDIF 134 141 135 !--- LAND MASK. T WOCASES:142 !--- LAND MASK. THREE CASES: 136 143 ! 1) read from ocean model file "o2a.nc" (coupled runs) 137 ! 2) computed from topography file "Relief.nc" (masque(:,:)=-99999.) 138 ! Coupled simulations (case 1) use the ocean model mask to compute the 144 ! 2) read from previous run file="startphy0.nc" 145 ! 3) computed from topography file "Relief.nc" (masque(:,:)=-99999.) 146 ! In the first case, the mask from the ocean model is used compute the 139 147 ! weights to ensure ocean fractions are the same for atmosphere and ocean. 140 148 !******************************************************************************* 141 IF(NF90_OPEN("o2a.nc", NF90_NOWRITE, nid_o2a)/=NF90_NOERR) THEN 142 WRITE(lunout,*)'BEWARE !! No ocean mask "o2a.nc" file found' 143 WRITE(lunout,*)'Forced run.' 144 masque(:,:)=-99999. 145 ELSE 149 IF(NF90_OPEN("o2a.nc", NF90_NOWRITE, nid_o2a)==NF90_NOERR) THEN 146 150 iret=NF90_CLOSE(nid_o2a) 147 151 WRITE(lunout,*)'BEWARE !! Ocean mask "o2a.nc" file found' … … 175 179 masque(iip1 ,:)=masque(1,:) 176 180 DEALLOCATE(ocemask) 181 ELSE IF(NF90_OPEN("startphy0.nc", NF90_NOWRITE, nid_sta)==NF90_NOERR) THEN 182 WRITE(lunout,*)'BEWARE !! File "startphy0.nc" found.' 183 WRITE(lunout,*)'Getting the land mask from a previous run.' 184 iret=NF90_INQ_DIMID(nid_sta,'points_physiques',nid_nph) 185 iret=NF90_INQUIRE_DIMENSION(nid_sta,nid_nph,len=nphys) 186 IF(nphys/=klon) THEN 187 WRITE(lunout,*)'Mismatching dimensions for land mask' 188 WRITE(lunout,*)'nphys = ',nphys ,' klon = ',klon 189 iret=NF90_CLOSE(nid_sta) 190 CALL abort_gcm(modname,'',1) 191 END IF 192 ALLOCATE(masktmp(klon)) 193 iret=NF90_INQ_VARID(nid_sta,'masque',nid_msk) 194 iret=NF90_GET_VAR(nid_sta,nid_msk,masktmp) 195 iret=NF90_CLOSE(nid_sta) 196 CALL gr_fi_dyn(1,klon,iip1,jjp1,masktmp,masque) 197 IF(prt_level>=1) THEN 198 WRITE(fmt,"(i4,'i1)')")iip1 ; fmt='('//ADJUSTL(fmt) 199 WRITE(lunout,*)'LAND MASK :' 200 WRITE(lunout,fmt) NINT(masque) 201 END IF 202 DEALLOCATE(masktmp) 203 ELSE 204 WRITE(lunout,*)'BEWARE !! No ocean mask "o2a.nc" file or "startphy0.nc" file found' 205 WRITE(lunout,*)'Land mask will be built from the topography file.' 206 masque(:,:)=-99999. 177 207 END IF 178 208 phis(:,:)=-99999.
Note: See TracChangeset
for help on using the changeset viewer.