Changeset 3719 for trunk/LMDZ.VENUS/libf/phyvenus/phyetat0.F90
- Timestamp:
- Apr 11, 2025, 3:56:08 PM (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.VENUS/libf/phyvenus/phyetat0.F90
r3451 r3719 1 ! 2 ! $Id $ 3 ! 1 module phyetat0_mod 2 3 implicit none 4 5 contains 6 4 7 subroutine phyetat0(fichnom) 5 8 ! Load initial state for the physics 6 9 ! and do some resulting initializations 7 10 8 USE dimphy 9 USE mod_grid_phy_lmdz 10 USE mod_phys_lmdz_para 11 USE iophy 12 USE phys_state_var_mod 13 USE iostart 14 use geometry_mod, only: longitude_deg, latitude_deg 15 USE time_phylmdz_mod, only: itau_phy, raz_date, pdtphys 16 USE ioipsl_getin_p_mod, only: getin_p 11 use dimphy, only: klon 12 use iophy, only: init_iophy_new 13 use phys_state_var_mod, only: ftsol, ftsoil, age, dlw, falbe, fder, q2, & 14 radsol, sollw, sollwdown, solsw, & 15 ancien_ok, t_ancien, & 16 zmea, zgam, zpic, zsig, zstd, zthe, zval 17 use iostart, only: get_var, get_field, open_startphy, close_startphy 18 use geometry_mod, only: longitude_deg, latitude_deg 19 use time_phylmdz_mod, only: itau_phy, raz_date, pdtphys 20 use ioipsl_getin_p_mod, only: getin_p 17 21 use nonoro_gwd_ran_mod, only: du_nonoro_gwd, dv_nonoro_gwd, & 18 22 east_gwstress, west_gwstress … … 20 24 implicit none 21 25 !====================================================================== 22 ! Auteur(s) Z.X. Li (LMD/CNRS) date: 1993081823 ! Objet: Lecture de l'etat initial pour la physique24 !======================================================================25 !include "netcdf.inc"26 26 include "dimsoil.h" 27 27 include "clesphys.h" … … 36 36 REAL :: lon_startphy(klon), lat_startphy(klon) 37 37 REAL :: surface_albedo 38 39 ! les variables globales lues dans le fichier restart 38 character(len=8) :: modname="phyetat0" 39 40 ! global variables read in startphy.nc file 40 41 41 42 ! open physics initial state file: … … 50 51 CALL get_var("controle",tab_cntrl,found) 51 52 IF (.not.found) THEN 52 PRINT*, 'phyetat0: Le champ <controle> est absent'53 CALL abort53 write(*,*) modname//': Field <controle> is missing' 54 call abort_physic(modname,"Missing <controle>",1) 54 55 ENDIF 55 56 … … 63 64 itau_phy = tab_cntrl(15) 64 65 65 ! Attention si raz_date estactive :66 ! i l faut remettre a zero itau_phy apresphyetat0 !66 ! Warning, if raz_date is active : 67 ! itau_phy must be re-set to zero after phyetat0 ! 67 68 IF (raz_date.eq.1) THEN 68 69 itau_phy=0 … … 81 82 call get_field("latitude",lat_startphy,found) 82 83 IF (.not.found) THEN 83 PRINT*, 'phyetat0: Le champ <latitude> est absent'84 CALL abort84 write(*,*) modname//':: Field <latitude> is missing' 85 call abort_physic(modname,"Missing <latitude>",1) 85 86 ENDIF 86 87 DO i=1,klon 87 88 IF (ABS(lat_startphy(i)-latitude_deg(i))>=0.01) THEN 88 WRITE(*,*) "phyetat0: Warning! Latitude discrepancy wrt startphy file:",&89 WRITE(*,*) modname//": Warning! Latitude discrepancy wrt startphy file:",& 89 90 " i=",i," lat_startphy(i)=",lat_startphy(i),& 90 91 " latitude_deg(i)=",latitude_deg(i) 91 CALL abort92 call abort_physic(modname,"<latitude> values discrepency",1) 92 93 ENDIF 93 94 ENDDO … … 96 97 call get_field("longitude",lon_startphy,found) 97 98 IF (.not.found) THEN 98 PRINT*, 'phyetat0: Le champ <longitude> est absent'99 CALL abort99 write(*,*)'phyetat0: Field <longitude> is missing' 100 call abort_physic(modname,"Missing <longitude>",1) 100 101 ENDIF 101 102 DO i=1,klon 102 103 IF (ABS(lon_startphy(i)-longitude_deg(i))>=0.01) THEN 103 WRITE(*,*) "phyetat0: Warning! Longitude discrepancy wrt startphy file:",&104 WRITE(*,*) modname//": Warning! Longitude discrepancy wrt startphy file:",& 104 105 " i=",i," lon_startphy(i)=",lon_startphy(i),& 105 106 " longitude_deg(i)=",longitude_deg(i) 106 CALL abort107 call abort_physic(modname,"<latitude> values discrepency",1) 107 108 ENDIF 108 109 ENDDO … … 115 116 CALL get_field("TS",ftsol(:),found) 116 117 IF (.not.found) THEN 117 PRINT*, 'phyetat0: Le champ <TS> est absent' 118 PRINT*, "phyetat0: Lecture echouee pour <TS>" 119 CALL abort 118 WRITE(*,*) modname//": Field <TS> is missing" 119 call abort_physic(modname,"Missing <TS>",1) 120 120 ELSE 121 PRINT*, 'phyetat0: Le champ <TS> est present'122 PRINT*,'Temperature du sol<TS>', minval(ftsol), maxval(ftsol)121 WRITE(*,*) modname//": Field <TS> is present" 122 WRITE(*,*) 'Surface temperature <TS>', minval(ftsol), maxval(ftsol) 123 123 ENDIF 124 124 ELSE … … 131 131 DO isoil=1, nsoilmx 132 132 IF (isoil.GT.99) THEN 133 PRINT*, "Trop de couches"134 CALL abort133 WRITE(*,*) "Too many layers!" 134 call abort_physic(modname,"Too many subsurface layers",1) 135 135 ENDIF 136 136 WRITE(str2,'(i2.2)') isoil 137 137 CALL get_field('Tsoil'//str2,ftsoil(:,isoil),found) 138 138 IF (.not.found) THEN 139 PRINT*, "phyetat0: Le champ <Tsoil"//str2//"> est absent"140 PRINT*, " Il prend donc la valeur de surface"139 WRITE(*,*) modname//": Field <Tsoil"//str2//"> is missing" 140 WRITE(*,*) " it will be nitialized with surface value" 141 141 DO i=1, klon 142 142 ftsoil(i,isoil)=ftsol(i) … … 153 153 CALL get_field("ALBE", falbe,found) 154 154 IF (.not.found) THEN 155 PRINT*, 'phyetat0: Le champ <ALBE> est absent' 156 PRINT*, "phyetat0: Lecture echouee pour <ALBE>" 157 CALL abort 155 WRITE(*,*) modname//": Field <ALBE> is missing" 156 call abort_physic(modname,"Missing <ALBE>",1) 158 157 ENDIF 159 158 ELSE … … 163 162 falbe(:)=surface_albedo 164 163 ENDIF ! of IF (startphy_file) 165 PRINT*,'Albedo du sol<ALBE>', minval(falbe), maxval(falbe)166 167 IF (startphy_file) THEN 168 ! Lecture rayonnement solaire au sol:164 WRITE(*,*) 'Surface albedo <ALBE>', minval(falbe), maxval(falbe) 165 166 IF (startphy_file) THEN 167 ! Solar flux to the surface: 169 168 CALL get_field("solsw",solsw,found) 170 169 IF (.not.found) THEN 171 PRINT*, 'phyetat0: Le champ <solsw> est absent'172 PRINT*, 'mis a zero'170 WRITE(*,*) modname//": Field <solsw> is missing" 171 WRITE(*,*) "set to zero" 173 172 solsw = 0. 174 173 ENDIF … … 177 176 solsw(:)=0 178 177 ENDIF ! of IF (startphy_file) 179 PRINT*,'Rayonnement solaire au solsolsw:', minval(solsw), maxval(solsw)180 181 IF (startphy_file) THEN 182 ! Lecture rayonnement IR au sol:178 WRITE(*,*) 'Solar flux to the surface solsw:', minval(solsw), maxval(solsw) 179 180 IF (startphy_file) THEN 181 ! IR flux to the surface: 183 182 CALL get_field("sollw",sollw,found) 184 183 IF (.not.found) THEN 185 PRINT*, 'phyetat0: Le champ <sollw> est absent'186 PRINT*, 'mis a zero'184 WRITE(*,*) modname//": Field <sollw> is missing" 185 WRITE(*,*) "set to zero" 187 186 sollw = 0. 188 187 ENDIF … … 191 190 sollw(:)=0 192 191 ENDIF ! of IF (startphy_file) 193 PRINT*,'Rayonnement IR au solsollw:', minval(sollw), maxval(solsw)194 195 IF (startphy_file) THEN 196 ! Lecture derive des flux:192 WRITE(*,*) 'IR flux to the surface sollw:', minval(sollw), maxval(solsw) 193 194 IF (startphy_file) THEN 195 ! Derivative of the sensible and latent fluxes: 197 196 CALL get_field("fder",fder,found) 198 197 IF (.not.found) THEN 199 PRINT*, 'phyetat0: Le champ <fder> est absent'200 PRINT*, 'mis a zero'198 WRITE(*,*) modname//": Field <fder> is missing" 199 WRITE(*,*) "set to zero" 201 200 fder = 0. 202 201 ENDIF … … 205 204 fder(:)=0 206 205 ENDIF ! of IF (startphy_file) 207 PRINT*,'Derive desflux fder:', minval(fder), maxval(fder)208 209 IF (startphy_file) THEN 210 ! Lecture derive flux IR:206 WRITE(*,*) 'Derivative of the flux fder:', minval(fder), maxval(fder) 207 208 IF (startphy_file) THEN 209 ! Derivative of the IR flux: 211 210 CALL get_field("dlw",dlw,found) 212 211 IF (.not.found) THEN 213 PRINT*, 'phyetat0: Le champ <dlw> est absent'214 PRINT*, 'mis a zero'212 WRITE(*,*) modname//": Field <dlw> is missing" 213 WRITE(*,*) "set to zero" 215 214 dlw = 0. 216 215 ENDIF … … 219 218 dlw(:)=0 220 219 ENDIF ! of IF (startphy_file) 221 PRINT*,'Derive flux IRdlw:', minval(dlw), maxval(dlw)222 223 IF (startphy_file) THEN 224 ! Lecture rayonnement IR vers le bas au sol:220 WRITE(*,*) 'Derivative of the IR flux dlw:', minval(dlw), maxval(dlw) 221 222 IF (startphy_file) THEN 223 ! Downward IR flux at the surface: 225 224 CALL get_field("sollwdown",sollwdown,found) 226 225 IF (.not.found) THEN 227 PRINT*, 'phyetat0: Le champ <sollwdown> est absent'228 PRINT*, 'mis a zero'226 WRITE(*,*) modname//": Field <sollwdown> is missing" 227 WRITE(*,*) "set to zero" 229 228 sollwdown = 0. 230 229 ENDIF … … 233 232 sollwdown(:)=0 234 233 ENDIF ! of IF (startphy_file) 235 PRINT*,'Flux IR vers le bas au solsollwdown:', minval(sollwdown), maxval(sollwdown)236 237 IF (startphy_file) THEN 238 ! Lecture du rayonnement net au sol:234 WRITE(*,*) 'Downward IR flux at the surface sollwdown:', minval(sollwdown), maxval(sollwdown) 235 236 IF (startphy_file) THEN 237 ! Net flux at the surface: 239 238 CALL get_field("RADS",radsol,found) 240 239 IF (.not.found) THEN 241 PRINT*, 'phyetat0: Le champ <RADS> est absent'242 CALL abort240 WRITE(*,*) modname//": Field <RADS> is missing" 241 call abort_physic(modname,"Missing <RADS>",1) 243 242 ENDIF 244 243 ELSE … … 246 245 radsol(:)=0 247 246 ENDIF ! of IF (startphy_file) 248 PRINT*,'Rayonnement net au solradsol:', minval(radsol), maxval(radsol)247 WRITE(*,*) 'Net flux at the surface radsol:', minval(radsol), maxval(radsol) 249 248 250 249 IF (startphy_file) THEN … … 252 251 CALL get_field("ZMEA",zmea,found) 253 252 IF (.not.found) THEN 254 PRINT*, 'phyetat0: Le champ <ZMEA> est absent'255 PRINT*, 'mis a zero'253 WRITE(*,*) modname//": Field <ZMEA> is missing" 254 WRITE(*,*) "set to zero" 256 255 zmea=0. 257 256 ENDIF … … 259 258 zmea(:)=0 260 259 ENDIF ! of IF (startphy_file) 261 PRINT*,'OROGRAPHIE SOUS-MAILLEzmea:', minval(zmea), maxval(zmea)260 WRITE(*,*) 'Subgrid scale orography zmea:', minval(zmea), maxval(zmea) 262 261 263 262 IF (startphy_file) THEN … … 265 264 CALL get_field("ZSTD",zstd,found) 266 265 IF (.not.found) THEN 267 PRINT*, 'phyetat0: Le champ <ZSTD> est absent'268 PRINT*, 'mis a zero'266 WRITE(*,*) modname//": Field <ZSTD> is missing" 267 WRITE(*,*) "set to zero" 269 268 zstd=0. 270 269 ENDIF … … 272 271 zstd(:)=0 273 272 ENDIF ! of IF (startphy_file) 274 PRINT*,'OROGRAPHIE SOUS-MAILLEzstd:', minval(zstd), maxval(zstd)273 WRITE(*,*) 'Subgrid scale orography zstd:', minval(zstd), maxval(zstd) 275 274 276 275 IF (startphy_file) THEN … … 278 277 CALL get_field("ZSIG",zsig,found) 279 278 IF (.not.found) THEN 280 PRINT*, 'phyetat0: Le champ <ZSIG> est absent'281 PRINT*, 'mis a zero'279 WRITE(*,*) modname//": Field <ZSIG> is missing" 280 WRITE(*,*) "set to zero" 282 281 zsig=0. 283 282 ENDIF … … 285 284 zsig(:)=0 286 285 ENDIF ! of IF (startphy_file) 287 PRINT*,'OROGRAPHIE SOUS-MAILLEzsig:', minval(zsig), maxval(zsig)286 WRITE(*,*) 'Subgrid scale orography zsig:', minval(zsig), maxval(zsig) 288 287 289 288 IF (startphy_file) THEN … … 291 290 CALL get_field("ZGAM",zgam,found) 292 291 IF (.not.found) THEN 293 PRINT*, 'phyetat0: Le champ <ZGAM> est absent'294 PRINT*, 'mis a zero'292 WRITE(*,*) modname//": Field <ZGAM> is missing" 293 WRITE(*,*) "set to zero" 295 294 zgam=0. 296 295 ENDIF … … 298 297 zgam(:)=0 299 298 ENDIF ! of IF (startphy_file) 300 PRINT*,'OROGRAPHIE SOUS-MAILLEzgam:', minval(zgam), maxval(zgam)299 WRITE(*,*) 'Subgrid scale orography zgam:', minval(zgam), maxval(zgam) 301 300 302 301 IF (startphy_file) THEN … … 304 303 CALL get_field("ZTHE",zthe,found) 305 304 IF (.not.found) THEN 306 PRINT*, 'phyetat0: Le champ <ZTHE> est absent'307 PRINT*, 'mis a zero'305 WRITE(*,*) modname//": Field <ZTHE> is missing" 306 WRITE(*,*) "set to zero" 308 307 zthe=0. 309 308 ENDIF … … 311 310 zthe(:)=0 312 311 ENDIF ! of IF (startphy_file) 313 PRINT*,'OROGRAPHIE SOUS-MAILLEzthe:', minval(zthe), maxval(zthe)312 WRITE(*,*) 'Subgrid scale orography zthe:', minval(zthe), maxval(zthe) 314 313 315 314 IF (startphy_file) THEN … … 317 316 CALL get_field("ZPIC",zpic,found) 318 317 IF (.not.found) THEN 319 PRINT*, 'phyetat0: Le champ <ZPIC> est absent'320 PRINT*, 'mis a zero'318 WRITE(*,*) modname//": Field <ZPIC> is missing" 319 WRITE(*,*) "set to zero" 321 320 zpic=0. 322 321 ENDIF … … 324 323 zpic(:)=0 325 324 ENDIF ! of IF (startphy_file) 326 PRINT*,'OROGRAPHIE SOUS-MAILLEzpic:', minval(zpic), maxval(zpic)325 WRITE(*,*) 'Subgrid scale orography zpic:', minval(zpic), maxval(zpic) 327 326 328 327 IF (startphy_file) THEN … … 330 329 CALL get_field("ZVAL",zval,found) 331 330 IF (.not.found) THEN 332 PRINT*, 'phyetat0: Le champ <ZVAL> est absent'333 PRINT*, 'mis a zero'331 WRITE(*,*) modname//": Field <ZVAL> is missing" 332 WRITE(*,*) "set to zero" 334 333 zval=0. 335 334 ENDIF … … 337 336 zval(:)=0 338 337 ENDIF ! of IF (startphy_file) 339 PRINT*,'OROGRAPHIE SOUS-MAILLEzval:', minval(zval), maxval(zval)338 WRITE(*,*) 'Subgrid scale orography zval:', minval(zval), maxval(zval) 340 339 341 340 IF (startphy_file) THEN … … 345 344 CALL get_field("TANCIEN",t_ancien,found) 346 345 IF (.not.found) THEN 347 PRINT*, "phyetat0: Le champ <TANCIEN> est absent"348 PRINT*, "Depart legerement fausse. Mais je continue"346 WRITE(*,*) modname//": Field <TANCIEN> is missing" 347 WRITE(*,*) "Slightly biaised start. But let's keep going." 349 348 ancien_ok = .FALSE. 350 349 ENDIF … … 368 367 CALL get_field("Q2",q2,found) 369 368 IF (.not.found) THEN 370 PRINT*, 'phyetat0: Le champ <Q2> est absent'371 PRINT*, 'mis a zero'369 WRITE(*,*) modname//": Field <Q2> is missing" 370 WRITE(*,*) "set to zero" 372 371 q2(:,:)=0. 373 372 ENDIF … … 376 375 q2(:,:)=0 377 376 ENDIF ! of IF (startphy_file) 378 PRINT*,'Turbulent Kinetic Energy', minval(q2), maxval(q2)377 WRITE(*,*) 'Turbulent Kinetic Energy', minval(q2), maxval(q2) 379 378 380 379 ! Non-orographic gravity waves … … 415 414 416 415 end subroutine phyetat0 416 417 end module phyetat0_mod
Note: See TracChangeset
for help on using the changeset viewer.