Changeset 1669
- Timestamp:
- Feb 21, 2017, 9:17:00 AM (8 years ago)
- Location:
- trunk/LMDZ.GENERIC
- Files:
-
- 6 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/README
r1622 r1669 1282 1282 of an initial date and month number and lenght). 1283 1283 1284 == 21/02/2017 == EM 1285 Added possibility to run without a startfi.nc file (mainly usefull for 1286 tests with coupling with dynamico dynamical core): 1287 - added flag "startphy_file" flag (.false. if doing an "academic" start 1288 on the physics side). 1289 - turned phyetat0.F90 into module phyetat0_mod.F90 1290 - turned tabfi.F into module tabfi_mod.F90 and added handling of 1291 startphy_file==.false. case 1292 - extra initializations in physiq_mod for startphy_file==.false. case. 1293 -
trunk/LMDZ.GENERIC/libf/dynphy_lonlat/phystd/newstart.F
r1589 r1669 37 37 USE temps_mod, ONLY: day_ini 38 38 USE ener_mod, ONLY: etot0,ptot0,ztot0,stot0,ang0 39 use tabfi_mod, only: tabfi 39 40 use iniphysiq_mod, only: iniphysiq 41 use phyetat0_mod, only: phyetat0 40 42 implicit none 41 43 … … 353 355 write(*,*) 'Reading file STARTFI' 354 356 fichnom = 'startfi.nc' 355 CALL phyetat0 (ngridmx,llm,fichnom,tab0,Lmodif,nsoilmx,357 CALL phyetat0(.true.,ngridmx,llm,fichnom,tab0,Lmodif,nsoilmx, 356 358 . nqtot,day_ini,time, 357 359 . tsurf,tsoil,emis,q2,qsurf, !) ! temporary modif by RDW -
trunk/LMDZ.GENERIC/libf/dynphy_lonlat/phystd/start2archive.F
r1593 r1669 37 37 USE temps_mod, ONLY: day_ini 38 38 USE iniphysiq_mod, ONLY: iniphysiq 39 use phyetat0_mod, only: phyetat0 39 40 implicit none 40 41 … … 234 235 235 236 236 CALL phyetat0 (ngridmx,llm,fichnom,0,Lmodif,nsoilmx,nqtot,237 CALL phyetat0(.true.,ngridmx,llm,fichnom,0,Lmodif,nsoilmx,nqtot, 237 238 . day_ini_fi,timefi, 238 239 . tsurf,tsoil,emis,q2,qsurf, -
trunk/LMDZ.GENERIC/libf/phystd/callkeys_mod.F90
r1520 r1669 105 105 !$OMP THREADPRIVATE(iscallphys) 106 106 107 ! do we read a startphy.nc file (default=.true.) 108 logical,save :: startphy_file=.true. 109 !$OMP THREADPRIVATE(startphy_file) 110 107 111 END MODULE callkeys_mod -
trunk/LMDZ.GENERIC/libf/phystd/inifis_mod.F90
r1542 r1669 95 95 call getin_p("iphysiq",iphysiq) ! call physics every iphysiq dyn step 96 96 97 ! do we read a startphy.nc file? (default: .true.) 98 call getin_p("startphy_file",startphy_file) 99 97 100 ! -------------------------------------------------------------- 98 101 ! Reading the "callphys.def" file controlling some key options -
trunk/LMDZ.GENERIC/libf/phystd/phyetat0_mod.F90
r1666 r1669 1 subroutine phyetat0 (ngrid,nlayer,fichnom,tab0,Lmodif,nsoil,nq, & 1 module phyetat0_mod 2 3 implicit none 4 5 contains 6 7 subroutine phyetat0 (startphy_file, & 8 ngrid,nlayer,fichnom,tab0,Lmodif,nsoil,nq, & 2 9 day_ini,time,tsurf,tsoil, & 3 10 emis,q2,qsurf,cloudfrac,totcloudfrac,hice, & 4 11 rnat,pctsrf_sic,tslab,tsea_ice,sea_ice) 5 12 6 13 use tabfi_mod, only: tabfi 7 14 USE tracer_h, ONLY: noms 8 15 USE surfdat_h, only: phisfi, albedodat, zmea, zstd, zsig, zgam, zthe … … 16 23 17 24 !====================================================================== 18 ! Auteur(s) Z.X. Li (LMD/CNRS) date: 1993081819 ! Adaptation à Mars : Yann Wanherdrick20 ! Objet: Lecture de l etat initial pour la physique21 !======================================================================22 #include "netcdf.inc"23 24 !======================================================================25 ! INTEGER nbsrf !Mars nbsrf a 1 au lieu de 426 ! PARAMETER (nbsrf=1) ! nombre de sous-fractions pour une maille27 !======================================================================28 25 ! Arguments: 29 26 ! --------- 30 27 ! inputs: 28 logical,intent(in) :: startphy_file ! .true. if reading start file 31 29 integer,intent(in) :: ngrid 32 30 integer,intent(in) :: nlayer … … 36 34 integer,intent(in) :: nsoil ! # of soil layers 37 35 integer,intent(in) :: nq 38 integer,intent( in) :: day_ini39 real,intent( in) :: time36 integer,intent(out) :: day_ini 37 real,intent(out) :: time 40 38 41 39 ! outputs: … … 81 79 INTEGER :: indextime=1 ! index of selected time, default value=1 82 80 logical :: found 81 82 character(len=8) :: modname="phyetat0" 83 83 84 84 ! … … 93 93 IF (.not. ALLOCATED(zthe)) ALLOCATE(zthe(ngrid)) 94 94 95 96 ! open physics initial state file: 97 call open_startphy(fichnom) 98 99 100 ! possibility to modify tab_cntrl in tabfi 101 write(*,*) 102 write(*,*) 'TABFI in phyeta0: Lmodif=',Lmodif," tab0=",tab0 103 call tabfi (ngrid,nid_start,Lmodif,tab0,day_ini,lmax,p_rad, & 95 if (startphy_file) then 96 ! open physics initial state file: 97 call open_startphy(fichnom) 98 99 ! possibility to modify tab_cntrl in tabfi 100 write(*,*) 101 write(*,*) 'TABFI in phyeta0: Lmodif=',Lmodif," tab0=",tab0 102 call tabfi (ngrid,nid_start,Lmodif,tab0,day_ini,lmax,p_rad, & 104 103 p_omeg,p_g,p_cpp,p_mugaz,p_daysec,time) 105 104 106 !c 107 !c Lecture des latitudes (coordonnees): 108 !c 109 ! ierr = NF_INQ_VARID (nid, "latitude", nvarid) 110 ! IF (ierr.NE.NF_NOERR) THEN 111 ! PRINT*, 'phyetat0: Le champ <latitude> est absent' 112 ! CALL abort 113 ! ENDIF 114 !#ifdef NC_DOUBLE 115 ! ierr = NF_GET_VARA_DOUBLE(nid,nvarid,sta,ngrid,lati) 116 !#else 117 ! ierr = NF_GET_VARA_REAL(nid,nvarid,sta,ngrid,lati) 118 !#endif 119 ! IF (ierr.NE.NF_NOERR) THEN 120 ! PRINT*, 'phyetat0: Lecture echouee pour <latitude>' 121 ! CALL abort 122 ! ENDIF 123 !c 124 !c Lecture des longitudes (coordonnees): 125 !c 126 ! ierr = NF_INQ_VARID (nid, "longitude", nvarid) 127 ! IF (ierr.NE.NF_NOERR) THEN 128 ! PRINT*, 'phyetat0: Le champ <longitude> est absent' 129 ! CALL abort 130 ! ENDIF 131 !#ifdef NC_DOUBLE 132 ! ierr = NF_GET_VARA_DOUBLE(nid,nvarid,sta,ngrid,long) 133 !#else 134 ! ierr = NF_GET_VARA_REAL(nid,nvarid,sta,ngrid,long) 135 !#endif 136 ! IF (ierr.NE.NF_NOERR) THEN 137 ! PRINT*, 'phyetat0: Lecture echouee pour <longitude>' 138 ! CALL abort 139 ! ENDIF 140 !c 141 !c Lecture des aires des mailles: 142 !c 143 ! ierr = NF_INQ_VARID (nid, "area", nvarid) 144 ! IF (ierr.NE.NF_NOERR) THEN 145 ! PRINT*, 'phyetat0: Le champ <area> est absent' 146 ! CALL abort 147 ! ENDIF 148 !#ifdef NC_DOUBLE 149 ! ierr = NF_GET_VARA_DOUBLE(nid,nvarid,sta,ngrid,area) 150 !#else 151 ! ierr = NF_GET_VARA_REAL(nid,nvarid,sta,ngrid,area) 152 !#endif 153 ! IF (ierr.NE.NF_NOERR) THEN 154 ! PRINT*, 'phyetat0: Lecture echouee pour <area>' 155 ! CALL abort 156 ! ENDIF 157 ! xmin = 1.0E+20 158 ! xmax = -1.0E+20 159 ! xmin = MINVAL(area) 160 ! xmax = MAXVAL(area) 161 ! PRINT*,'Aires des mailles <area>:', xmin, xmax 162 163 ! Load surface geopotential: 164 call get_field("phisfi",phisfi,found) 165 if (.not.found) then 166 write(*,*) "phyetat0: Failed loading <phisfi>" 167 call abort 168 else 169 write(*,*) "phyetat0: surface geopotential <phisfi> range:", & 170 minval(phisfi), maxval(phisfi) 171 endif 172 173 ! Load bare ground albedo: 174 call get_field("albedodat",albedodat,found) 175 if (.not.found) then 176 write(*,*) "phyetat0: Failed loading <albedodat>" 177 call abort 178 else 179 write(*,*) "phyetat0: Bare ground albedo <albedodat> range:", & 105 else ! "academic" initialization of planetary parameters via tabfi 106 call tabfi (ngrid,0,0,0,day_ini,lmax,p_rad, & 107 p_omeg,p_g,p_cpp,p_mugaz,p_daysec,time) 108 endif ! of if (startphy_file) 109 110 if (startphy_file) then 111 ! Load surface geopotential: 112 call get_field("phisfi",phisfi,found) 113 if (.not.found) then 114 call abort_physic(modname,"Failed loading <phisfi>",1) 115 endif 116 else 117 phisfi(:)=0 118 endif ! of if (startphy_file) 119 write(*,*) "phyetat0: surface geopotential <phisfi> range:", & 120 minval(phisfi), maxval(phisfi) 121 122 if (startphy_file) then 123 ! Load bare ground albedo: 124 call get_field("albedodat",albedodat,found) 125 if (.not.found) then 126 call abort_physic(modname,"Failed loading <albedodat>",1) 127 endif 128 else 129 albedodat(:)=0.5 ! would be better to read value from def file... 130 endif ! of if (startphy_file) 131 write(*,*) "phyetat0: Bare ground albedo <albedodat> range:", & 180 132 minval(albedodat), maxval(albedodat) 181 endif182 133 183 134 ! ZMEA 184 call get_field("ZMEA",zmea,found) 185 if (.not.found) then 186 write(*,*) "phyetat0: Failed loading <ZMEA>" 187 call abort 188 else 189 write(*,*) "phyetat0: <ZMEA> range:", & 135 if (startphy_file) then 136 call get_field("ZMEA",zmea,found) 137 if (.not.found) then 138 call abort_physic(modname,"Failed loading <ZMEA>",1) 139 endif 140 else 141 zmea(:)=0 142 endif ! of if (startphy_file) 143 write(*,*) "phyetat0: <ZMEA> range:", & 190 144 minval(zmea), maxval(zmea) 191 endif192 145 193 146 ! ZSTD 194 call get_field("ZSTD",zstd,found) 195 if (.not.found) then 196 write(*,*) "phyetat0: Failed loading <ZSTD>" 197 call abort 198 else 199 write(*,*) "phyetat0: <ZSTD> range:", & 147 if (startphy_file) then 148 call get_field("ZSTD",zstd,found) 149 if (.not.found) then 150 call abort_physic(modname,"Failed loading <ZSTD>",1) 151 endif 152 else 153 zstd(:)=0 154 endif ! of if (startphy_file) 155 write(*,*) "phyetat0: <ZSTD> range:", & 200 156 minval(zstd), maxval(zstd) 201 endif202 157 203 158 ! ZSIG 204 call get_field("ZSIG",zsig,found) 205 if (.not.found) then 206 write(*,*) "phyetat0: Failed loading <ZSIG>" 207 call abort 208 else 209 write(*,*) "phyetat0: <ZSIG> range:", & 159 if (startphy_file) then 160 call get_field("ZSIG",zsig,found) 161 if (.not.found) then 162 call abort_physic(modname,"Failed loading <ZSIG>",1) 163 endif 164 else 165 zsig(:)=0 166 endif ! of if (startphy_file) 167 write(*,*) "phyetat0: <ZSIG> range:", & 210 168 minval(zsig), maxval(zsig) 211 endif212 169 213 170 ! ZGAM 214 call get_field("ZGAM",zgam,found) 215 if (.not.found) then 216 write(*,*) "phyetat0: Failed loading <ZGAM>" 217 call abort 218 else 219 write(*,*) "phyetat0: <ZGAM> range:", & 171 if (startphy_file) then 172 call get_field("ZGAM",zgam,found) 173 if (.not.found) then 174 call abort_physic(modname,"Failed loading <ZGAM>",1) 175 endif 176 else 177 zgam(:)=0 178 endif ! of if (startphy_file) 179 write(*,*) "phyetat0: <ZGAM> range:", & 220 180 minval(zgam), maxval(zgam) 221 endif222 181 223 182 ! ZTHE 224 call get_field("ZTHE",zthe,found) 225 if (.not.found) then 226 write(*,*) "phyetat0: Failed loading <ZTHE>" 227 call abort 228 else 229 write(*,*) "phyetat0: <ZTHE> range:", & 183 if (startphy_file) then 184 call get_field("ZTHE",zthe,found) 185 if (.not.found) then 186 call abort_physic(modname,"Failed loading <ZTHE>",1) 187 endif 188 else 189 zthe(:)=0 190 endif ! of if (startphy_file) 191 write(*,*) "phyetat0: <ZTHE> range:", & 230 192 minval(zthe), maxval(zthe) 231 endif232 193 233 194 ! Surface temperature : 234 call get_field("tsurf",tsurf,found,indextime) 235 if (.not.found) then 236 write(*,*) "phyetat0: Failed loading <tsurf>" 237 call abort 238 else 239 write(*,*) "phyetat0: Surface temperature <tsurf> range:", & 195 if (startphy_file) then 196 call get_field("tsurf",tsurf,found,indextime) 197 if (.not.found) then 198 call abort_physic(modname,"Failed loading <tsurf>",1) 199 endif 200 else 201 tsurf(:)=0 ! will be updated afterwards in physiq ! 202 endif ! of if (startphy_file) 203 write(*,*) "phyetat0: Surface temperature <tsurf> range:", & 240 204 minval(tsurf), maxval(tsurf) 241 endif242 205 243 206 ! Surface emissivity 244 call get_field("emis",emis,found,indextime) 245 if (.not.found) then 246 write(*,*) "phyetat0: Failed loading <emis>" 247 call abort 248 else 249 write(*,*) "phyetat0: Surface emissivity <emis> range:", & 207 if (startphy_file) then 208 call get_field("emis",emis,found,indextime) 209 if (.not.found) then 210 call abort_physic(modname,"Failed loading <emis>",1) 211 endif 212 else 213 emis(:)=1 ! would be better to read value from def file... 214 endif ! of if (startphy_file) 215 write(*,*) "phyetat0: Surface emissivity <emis> range:", & 250 216 minval(emis), maxval(emis) 251 endif252 217 253 218 ! Cloud fraction (added by BC 2010) 254 219 if (CLFvarying) then 255 call get_field("cloudfrac",cloudfrac,found,indextime) 256 if (.not.found) then 257 write(*,*) "phyetat0: Failed loading <cloudfrac>" 258 call abort 259 else 220 if (startphy_file) then 221 call get_field("cloudfrac",cloudfrac,found,indextime) 222 if (.not.found) then 223 call abort_physic(modname,"Failed loading <cloudfrac>",1) 224 endif 225 else 226 cloudfrac(:,:)=0 227 endif ! of if (startphy_file) 260 228 write(*,*) "phyetat0: Cloud fraction <cloudfrac> range:", & 261 minval(cloudfrac), maxval(cloudfrac) 262 endif 263 else 264 cloudfrac(:,:)=0.0 265 endif 229 minval(cloudfrac), maxval(cloudfrac) 230 else 231 cloudfrac(:,:)=0.0 232 endif ! of if (CLFvarying) 266 233 267 234 ! Total cloud fraction (added by BC 2010) 268 235 if (CLFvarying) then 269 call get_field("totcloudfrac",totcloudfrac,found,indextime) 270 if (.not.found) then 271 write(*,*) "phyetat0: Failed loading <totcloudfrac>" 272 call abort 273 else 236 if (startphy_file) then 237 call get_field("totcloudfrac",totcloudfrac,found,indextime) 238 if (.not.found) then 239 call abort_physic(modname,"Failed loading <totcloudfrac>",1) 240 endif 241 else 242 totcloudfrac(:)=0 243 endif ! of if (startphy_file) 274 244 write(*,*) "phyetat0: Total cloud fraction <totcloudfrac> range:", & 275 245 minval(totcloudfrac), maxval(totcloudfrac) 276 endif 277 else 278 totcloudfrac(:)=0.0 279 endif 246 else 247 totcloudfrac(:)=0.0 248 endif ! of if (CLFvarying) 280 249 281 250 ! Height of oceanic ice (added by BC 2010) 282 call get_field("hice",hice,found,indextime) 283 if (.not.found) then 284 write(*,*) "phyetat0: Failed loading <hice>" 285 ! call abort 286 do ig=1,ngrid 287 hice(ig)=0. 288 enddo 289 else 290 write(*,*) "phyetat0: Height of oceanic ice <hice> range:", & 251 if (startphy_file) then 252 call get_field("hice",hice,found,indextime) 253 if (.not.found) then 254 write(*,*) "phyetat0: Failed loading <hice>" 255 ! call abort 256 hice(:)=0 257 endif 258 else 259 hice(:)=0 260 endif ! of if (startphy_file) 261 write(*,*) "phyetat0: Height of oceanic ice <hice> range:", & 291 262 minval(hice), maxval(hice) 292 endif293 263 294 264 ! SLAB OCEAN (added by BC 2014) 295 ! nature of the surface 296 call get_field("rnat",rnat,found,indextime) 297 if (.not.found) then 298 write(*,*) "phyetat0: Failed loading <rnat>" 299 do ig=1,ngrid 300 rnat(ig)=1. 301 enddo 302 else 265 if (startphy_file) then 266 ! nature of the surface 267 call get_field("rnat",rnat,found,indextime) 268 if (.not.found) then 269 write(*,*) "phyetat0: Failed loading <rnat>" 270 rnat(1:ngrid)=1. 271 else 303 272 do ig=1,ngrid 304 273 if((nint(rnat(ig)).eq.2).or.(nint(rnat(ig)).eq.0))then … … 308 277 endif 309 278 enddo 310 311 write(*,*) "phyetat0: Nature of surface <rnat> range:", & 279 endif ! of if (.not.found) 280 else 281 rnat(:)=1 282 endif ! of if (startphy_file) 283 write(*,*) "phyetat0: Nature of surface <rnat> range:", & 312 284 minval(rnat), maxval(rnat) 313 endif 314 ! Pourcentage of sea ice cover 315 call get_field("pctsrf_sic",pctsrf_sic,found,indextime) 316 if (.not.found) then 317 write(*,*) "phyetat0: Failed loading <pctsrf_sic>" 318 do ig=1,ngrid 319 pctsrf_sic(ig)=0. 320 enddo 321 else 322 write(*,*) "phyetat0: Pourcentage of sea ice cover <pctsrf_sic> range:", & 285 286 if (startphy_file) then 287 ! Pourcentage of sea ice cover 288 call get_field("pctsrf_sic",pctsrf_sic,found,indextime) 289 if (.not.found) then 290 write(*,*) "phyetat0: Failed loading <pctsrf_sic>" 291 pctsrf_sic(1:ngrid)=0. 292 endif 293 else 294 pctsrf_sic(:)=0 295 endif ! of if (startphy_file) 296 write(*,*) "phyetat0: Pourcentage of sea ice cover <pctsrf_sic> range:", & 323 297 minval(pctsrf_sic), maxval(pctsrf_sic) 324 endif 325 ! Slab ocean temperature (2 layers) 326 call get_field("tslab",tslab,found,indextime) 327 if (.not.found) then 328 write(*,*) "phyetat0: Failed loading <tslab>" 329 do ig=1,ngrid 330 do iq=1,noceanmx 331 tslab(ig,iq)=tsurf(ig) 332 enddo 333 enddo 334 else 335 write(*,*) "phyetat0: Slab ocean temperature <tslab> range:", & 298 299 if (startphy_file) then 300 ! Slab ocean temperature (2 layers) 301 call get_field("tslab",tslab,found,indextime) 302 if (.not.found) then 303 write(*,*) "phyetat0: Failed loading <tslab>" 304 do iq=1,noceanmx 305 tslab(1:ngrid,iq)=tsurf(1:ngrid) 306 enddo 307 endif 308 else 309 do iq=1,noceanmx 310 tslab(1:ngrid,iq)=tsurf(1:ngrid) 311 enddo 312 endif ! of if (startphy_file) 313 write(*,*) "phyetat0: Slab ocean temperature <tslab> range:", & 336 314 minval(tslab), maxval(tslab) 337 endif 338 ! Oceanic ice temperature 339 call get_field("tsea_ice",tsea_ice,found,indextime) 340 if (.not.found) then 341 write(*,*) "phyetat0: Failed loading <tsea_ice>" 342 do ig=1,ngrid 343 tsea_ice(ig)=273.15-1.8 344 enddo 345 else 346 write(*,*) "phyetat0: Oceanic ice temperature <tsea_ice> range:", & 315 316 if (startphy_file) then 317 ! Oceanic ice temperature 318 call get_field("tsea_ice",tsea_ice,found,indextime) 319 if (.not.found) then 320 write(*,*) "phyetat0: Failed loading <tsea_ice>" 321 tsea_ice(1:ngrid)=273.15-1.8 322 endif 323 else 324 tsea_ice(1:ngrid)=273.15-1.8 325 endif ! of if (startphy_file) 326 write(*,*) "phyetat0: Oceanic ice temperature <tsea_ice> range:", & 347 327 minval(tsea_ice), maxval(tsea_ice) 348 endif 349 ! Oceanic ice quantity (kg/m^2) 350 call get_field("sea_ice",sea_ice,found,indextime) 351 if (.not.found) then 352 write(*,*) "phyetat0: Failed loading <sea_ice>" 353 do ig=1,ngrid 354 tsea_ice(ig)=0. 355 enddo 356 else 357 write(*,*) "phyetat0: Oceanic ice quantity <sea_ice> range:", & 328 329 if (startphy_file) then 330 ! Oceanic ice quantity (kg/m^2) 331 call get_field("sea_ice",sea_ice,found,indextime) 332 if (.not.found) then 333 write(*,*) "phyetat0: Failed loading <sea_ice>" 334 tsea_ice(1:ngrid)=0. 335 endif 336 else 337 tsea_ice(1:ngrid)=0 338 endif ! of if (startphy_file) 339 write(*,*) "phyetat0: Oceanic ice quantity <sea_ice> range:", & 358 340 minval(sea_ice), maxval(sea_ice) 359 endif360 361 362 341 363 342 364 343 ! pbl wind variance 365 call get_field("q2",q2,found,indextime) 366 if (.not.found) then 367 write(*,*) "phyetat0: Failed loading <q2>" 368 call abort 369 else 370 write(*,*) "phyetat0: PBL wind variance <q2> range:", & 344 if (startphy_file) then 345 call get_field("q2",q2,found,indextime) 346 if (.not.found) then 347 call abort_physic(modname,"Failed loading <q2>",1) 348 endif 349 else 350 q2(:,:)=0 351 endif ! of if (startphy_file) 352 write(*,*) "phyetat0: PBL wind variance <q2> range:", & 371 353 minval(q2), maxval(q2) 372 endif373 354 374 355 ! tracer on surface … … 376 357 do iq=1,nq 377 358 txt=noms(iq) 378 379 !! There was a bug here. MT2015. 380 381 !if (txt.eq."h2o_vap") then 382 ! There is no surface tracer for h2o_vap; 383 ! "h2o_ice" should be loaded instead 384 ! txt="h2o_ice" 385 ! write(*,*) 'phyetat0: loading surface tracer', & 386 ! ' h2o_ice instead of h2o_vap' 387 !endif 388 389 call get_field(txt,qsurf(:,iq),found,indextime) 390 if (.not.found) then 391 write(*,*) "phyetat0: Failed loading <",trim(txt),">" 392 write(*,*) " ",trim(txt)," is set to zero" 393 qsurf(:,iq) = 0. 359 if (startphy_file) then 360 call get_field(txt,qsurf(:,iq),found,indextime) 361 if (.not.found) then 362 write(*,*) "phyetat0: Failed loading <",trim(txt),">" 363 write(*,*) " ",trim(txt)," is set to zero" 364 qsurf(:,iq) = 0. 365 endif 394 366 else 395 write(*,*) "phyetat0: Surface tracer <",trim(txt),"> range:", & 367 qsurf(:,iq)=0 368 endif ! of if (startphy_file) 369 write(*,*) "phyetat0: Surface tracer <",trim(txt),"> range:", & 396 370 minval(qsurf(:,iq)), maxval(qsurf(:,iq)) 397 endif 398 enddo 371 enddo! of do iq=1,nq 399 372 endif ! of if (nq.ge.1) 400 373 401 374 402 ! Call to soil_settings, in order to read soil temperatures, 403 ! as well as thermal inertia and volumetric heat capacity 404 call soil_settings(nid_start,ngrid,nsoil,tsurf,tsoil,indextime) 375 if (startphy_file) then 376 ! Call to soil_settings, in order to read soil temperatures, 377 ! as well as thermal inertia and volumetric heat capacity 378 call soil_settings(nid_start,ngrid,nsoil,tsurf,tsoil,indextime) 379 endif ! of if (startphy_file) 405 380 ! 406 381 ! close file: 407 382 ! 408 call close_startphy 409 410 END SUBROUTINE phyetat0 383 if (startphy_file) call close_startphy 384 385 end subroutine phyetat0 386 387 end module phyetat0_mod -
trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90
r1637 r1669 32 32 igcm_co2_ice 33 33 use time_phylmdz_mod, only: ecritphy, iphysiq, nday 34 use phyetat0_mod, only: phyetat0 34 35 use phyredem, only: physdem0, physdem1 35 36 use slab_ice_h, only: capcalocean, capcalseaice,capcalsno, & … … 162 163 ! ------------------ 163 164 164 #include "netcdf.inc"165 include "netcdf.inc" 165 166 166 167 ! Arguments : … … 244 245 real pw(ngrid,nlayer) ! Vertical velocity (m/s). (NOTE : >0 WHEN DOWNWARDS !!) 245 246 246 integer l,ig,ierr,iq,nw 247 integer l,ig,ierr,iq,nw,isoil 247 248 248 249 ! FOR DIAGNOSTIC : … … 531 532 ! Read 'startfi.nc' file. 532 533 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 533 call phyetat0(ngrid,nlayer,"startfi.nc",0,0,nsoilmx,nq, & 534 call phyetat0(startphy_file, & 535 ngrid,nlayer,"startfi.nc",0,0,nsoilmx,nq, & 534 536 day_ini,time_phys,tsurf,tsoil,emis,q2,qsurf, & 535 537 cloudfrac,totcloudfrac,hice, & 536 538 rnat,pctsrf_sic,tslab, tsea_ice,sea_ice) 539 if (.not.startphy_file) then 540 ! additionnal "academic" initialization of physics 541 if (is_master) write(*,*) "Physiq: initializing tsurf(:) to pt(:,1) !!" 542 tsurf(:)=pt(:,1) 543 if (is_master) write(*,*) "Physiq: initializing tsoil(:) to pt(:,1) !!" 544 do isoil=1,nsoilmx 545 tsoil(1:ngrid,isoil)=tsurf(1:ngrid) 546 enddo 547 if (is_master) write(*,*) "Physiq: initializing day_ini to pdat !" 548 day_ini=pday 549 endif 537 550 538 551 if (pday.ne.day_ini) then -
trunk/LMDZ.GENERIC/libf/phystd/tabfi_mod.F90
r1666 r1669 1 c======================================================================= 2 SUBROUTINE tabfi(ngrid,nid,Lmodif,tab0,day_ini,lmax,p_rad, 3 . p_omeg,p_g,p_cpp,p_mugaz,p_daysec,time) 4 c======================================================================= 5 c 6 c C. Hourdin 15/11/96 7 c 8 c Object: Lecture du tab_cntrl physique dans un fichier 9 c ------ et initialisation des constantes physiques 10 c 11 c Arguments: 12 c ---------- 13 c 14 c Inputs: 15 c ------ 16 c 17 c - nid: unitne logique du fichier ou on va lire le tab_cntrl 18 c (ouvert dans le programme appellant) 19 c 20 c si nid=0: 21 c pas de lecture du tab_cntrl mais 22 c Valeurs par default des constantes physiques 23 c 24 c - tab0: Offset de tab_cntrl a partir duquel sont ranges 25 c les parametres physiques (50 pour start_archive) 26 c 27 c - Lmodif: si on souhaite modifier les constantes Lmodif = 1 = TRUE 28 c 29 c 30 c Outputs: 31 c -------- 32 c 33 c - day_ini: tab_cntrl(tab0+3) (Dans les cas ou l'on souhaite 34 c comparer avec le day_ini dynamique) 35 c 36 c - lmax: tab_cntrl(tab0+2) (pour test avec nlayer) 37 c 38 c - p_rad 39 c - p_omeg ! 40 c - p_g ! Constantes physiques ayant des 41 c - p_mugaz ! homonymes dynamiques 42 c - p_daysec ! 43 c 44 c======================================================================= 45 ! to use 'getin' 46 use ioipsl_getincom , only: getin 47 48 use surfdat_h, only: emisice, iceradius, dtemisice, 49 & emissiv 1 MODULE tabfi_mod 2 3 IMPLICIT NONE 4 5 CONTAINS 6 7 !======================================================================= 8 SUBROUTINE tabfi(ngrid,nid,Lmodif,tab0,day_ini,lmax,p_rad, & 9 p_omeg,p_g,p_cpp,p_mugaz,p_daysec,time) 10 !======================================================================= 11 ! 12 ! C. Hourdin 15/11/96 13 ! 14 ! Object: Lecture du tab_cntrl physique dans un fichier 15 ! ------ et initialisation des constantes physiques 16 ! 17 ! Arguments: 18 ! ---------- 19 ! 20 ! Inputs: 21 ! ------ 22 ! 23 ! - nid: unitne logique du fichier ou on va lire le tab_cntrl 24 ! (ouvert dans le programme appellant) 25 ! 26 ! si nid=0: 27 ! pas de lecture du tab_cntrl mais 28 ! Valeurs par default des constantes physiques 29 ! 30 ! - tab0: Offset de tab_cntrl a partir duquel sont ranges 31 ! les parametres physiques (50 pour start_archive) 32 ! 33 ! - Lmodif: si on souhaite modifier les constantes Lmodif = 1 = TRUE 34 ! 35 ! 36 ! Outputs: 37 ! -------- 38 ! 39 ! - day_ini: tab_cntrl(tab0+3) (Dans les cas ou l'on souhaite 40 ! comparer avec le day_ini dynamique) 41 ! 42 ! - lmax: tab_cntrl(tab0+2) (pour test avec nlayer) 43 ! 44 ! - p_rad 45 ! - p_omeg ! 46 ! - p_g ! Constantes physiques ayant des 47 ! - p_mugaz ! homonymes dynamiques 48 ! - p_daysec ! 49 ! 50 !======================================================================= 51 ! to use 'getin_p' 52 use ioipsl_getin_p_mod, only: getin_p 53 54 use surfdat_h, only: emisice, iceradius, dtemisice, & 55 emissiv 50 56 use comsoil_h, only: volcapa 51 57 use iostart, only: get_var 52 58 use mod_phys_lmdz_para, only: is_parallel 53 use planete_mod, only: year_day, periastr, apoastr, peri_day, 54 &obliquit, z0, lmixmin, emin_turb59 use planete_mod, only: year_day, periastr, apoastr, peri_day, & 60 obliquit, z0, lmixmin, emin_turb 55 61 use comcstfi_mod, only: rad, omeg, g, mugaz, rcp, cpp, r 56 62 use time_phylmdz_mod, only: dtphys, daysec … … 58 64 implicit none 59 65 60 #include "netcdf.inc"61 62 c-----------------------------------------------------------------------63 cDeclarations64 c-----------------------------------------------------------------------65 66 cArguments67 c---------66 include "netcdf.inc" 67 68 !----------------------------------------------------------------------- 69 ! Declarations 70 !----------------------------------------------------------------------- 71 72 ! Arguments 73 ! --------- 68 74 INTEGER,INTENT(IN) :: ngrid,nid,tab0 69 75 INTEGER*4,INTENT(OUT) :: day_ini … … 72 78 REAL,INTENT(OUT) :: p_rad,p_omeg,p_g,p_cpp,p_mugaz,p_daysec,time 73 79 74 cVariables75 c---------80 ! Variables 81 ! --------- 76 82 INTEGER,PARAMETER :: length=100 77 83 REAL tab_cntrl(length) ! array in which are stored the run's parameters … … 80 86 CHARACTER modif*20 81 87 LOGICAL :: found 88 CHARACTER(len=5) :: modname="tabfi" 82 89 83 90 write(*,*)"tabfi: nid=",nid," tab0=",tab0," Lmodif=",Lmodif 84 91 85 92 IF (nid.eq.0) then 86 c----------------------------------------------------------------------- 87 c Initialization of various physical constants to defaut values (nid = 0 case) 88 c----------------------------------------------------------------------- 93 !----------------------------------------------------------------------- 94 ! Initialization of various physical constants to defaut values (nid = 0 case) 95 !----------------------------------------------------------------------- 96 tab_cntrl(:)=0 97 lmax=0 ! not used anyways 98 !day_ini already set via inifis 99 time=0 100 ! Informations about planet for dynamics and physics 101 ! rad,cpp,g,r,rcp already initialized by inifis 102 omeg=-999. 103 call getin_p("omega",omeg) 104 if (omeg.eq.-999.) then 105 call abort_physic(modname,"Missing value for omega in def files!",1) 106 endif 107 mugaz=(8.3144621/r)*1.E3 108 ! daysec already set by inifis 109 ! dtphys alread set by inifis 110 ! Informations about planet for the physics only 111 year_day=-999. ! length of year, in standard days 112 call getin_p("year_day",year_day) 113 if (year_day.eq.-999.) then 114 call abort_physic(modname, & 115 "Missing value for year_day in def files!",1) 116 endif 117 periastr=-999. 118 call getin_p("periastron",periastr) 119 if (periastr.eq.-999.) then 120 call abort_physic(modname, & 121 "Missing value for periastron in def files!",1) 122 endif 123 apoastr=-999. 124 call getin_p("apoastron",apoastr) 125 if (apoastr.eq.-999.) then 126 call abort_physic(modname, & 127 "Missing value for apoastron in def files!",1) 128 endif 129 peri_day=-999. 130 call getin_p("periastron_day",peri_day) 131 if (peri_day.eq.-999.) then 132 call abort_physic(modname, & 133 "Missing value for periastron date in def files!",1) 134 endif 135 obliquit=-999. 136 call getin_p("obliquity",obliquit) 137 if (obliquit.eq.-999.) then 138 call abort_physic(modname, & 139 "Missing value for obliquity in def files!",1) 140 endif 141 ! boundary layer and turbulence 142 z0=1.e-2 ! surface roughness length (m) 143 lmixmin=30 144 emin_turb=1.e-6 145 ! optical properties of polar caps and ground emissivity 146 emisice(:)=0 147 emissiv=0 148 iceradius(:)=1.e-6 ! mean scat radius of CO2 snow 149 dtemisice(:)=0 !time scale for snow metamorphism 150 volcapa=1000000 ! volumetric heat capacity of subsurface 151 89 152 ELSE 90 c-----------------------------------------------------------------------91 cInitialization of physical constants by reading array tab_cntrl(:)92 cwhich contains these parameters (nid != 0 case)93 c-----------------------------------------------------------------------94 cRead 'controle' array95 c 153 !----------------------------------------------------------------------- 154 ! Initialization of physical constants by reading array tab_cntrl(:) 155 ! which contains these parameters (nid != 0 case) 156 !----------------------------------------------------------------------- 157 ! Read 'controle' array 158 ! 96 159 97 160 call get_var("controle",tab_cntrl,found) 98 161 if (.not.found) then 99 write(*,*)"tabfi: Failed reading <controle> array" 100 call abort 162 call abort_physic(modname,"Failed reading <controle> array",1) 101 163 else 102 164 write(*,*)'tabfi: tab_cntrl',tab_cntrl 103 165 endif 104 c 105 cInitialization of some physical constants106 cinformations on physics grid166 ! 167 ! Initialization of some physical constants 168 ! informations on physics grid 107 169 ! if(ngrid.ne.tab_cntrl(tab0+1)) then 108 170 ! print*,'tabfi: WARNING !!! tab_cntrl(tab0+1).ne.ngrid' … … 113 175 time = tab_cntrl(tab0+4) 114 176 write (*,*) 'IN tabfi day_ini=',day_ini 115 cInformations about planet for dynamics and physics177 ! Informations about planet for dynamics and physics 116 178 rad = tab_cntrl(tab0+5) 117 179 omeg = tab_cntrl(tab0+6) … … 122 184 daysec = tab_cntrl(tab0+10) 123 185 dtphys = tab_cntrl(tab0+11) 124 cInformations about planet for the physics only186 ! Informations about planet for the physics only 125 187 year_day = tab_cntrl(tab0+14) 126 188 periastr = tab_cntrl(tab0+15) … … 128 190 peri_day = tab_cntrl(tab0+17) 129 191 obliquit = tab_cntrl(tab0+18) 130 c boundary layer and turbeulence192 ! boundary layer and turbulence 131 193 z0 = tab_cntrl(tab0+19) 132 194 lmixmin = tab_cntrl(tab0+20) 133 195 emin_turb = tab_cntrl(tab0+21) 134 coptical properties of polar caps and ground emissivity196 ! optical properties of polar caps and ground emissivity 135 197 emisice(1) = tab_cntrl(tab0+24) 136 198 emisice(2) = tab_cntrl(tab0+25) … … 140 202 dtemisice(1)= tab_cntrl(tab0+33) !time scale for snow metamorphism (north) 141 203 dtemisice(2)= tab_cntrl(tab0+34) !time scale for snow metamorphism (south) 142 csoil properties204 ! soil properties 143 205 volcapa = tab_cntrl(tab0+35) ! volumetric heat capacity 144 c-----------------------------------------------------------------------145 cSave some constants for later use (as routine arguments)146 c-----------------------------------------------------------------------206 !----------------------------------------------------------------------- 207 ! Save some constants for later use (as routine arguments) 208 !----------------------------------------------------------------------- 147 209 p_omeg = omeg 148 210 p_g = g … … 154 216 ENDIF ! end of (nid = 0) 155 217 156 c-----------------------------------------------------------------------157 cWrite physical constants to output before modifying them158 c-----------------------------------------------------------------------218 !----------------------------------------------------------------------- 219 ! Write physical constants to output before modifying them 220 !----------------------------------------------------------------------- 159 221 160 222 6 FORMAT(a20,e15.6,e15.6) … … 198 260 write(*,*) 'Lmodif in tabfi!!!!!!!',Lmodif 199 261 200 c-----------------------------------------------------------------------201 cModifications...262 !----------------------------------------------------------------------- 263 ! Modifications... 202 264 ! NB: Modifying controls should only be done by newstart, and in seq mode 203 265 if ((Lmodif.eq.1).and.is_parallel) then 204 write(*,*) "tabfi: Error modifying tab_control should", 205 &" only happen in serial mode (eg: by newstart)"266 write(*,*) "tabfi: Error modifying tab_control should", & 267 " only happen in serial mode (eg: by newstart)" 206 268 stop 207 269 endif 208 c-----------------------------------------------------------------------270 !----------------------------------------------------------------------- 209 271 210 272 IF(Lmodif.eq.1) then … … 222 284 write(*,*) '(24 et 25) emisice : CO2 ice max emissivity ' 223 285 write(*,*) '(31 et 32) iceradius : mean scat radius of CO2 snow' 224 write(*,*) '(33 et 34) dtemisice : time scale for snow', 225 & 'metamorphism' 286 write(*,*) '(33 et 34) dtemisice : time scale for snow metamorphism' 226 287 write(*,*) '(35) volcapa : soil volumetric heat capacity' 227 288 write(*,*) '(18) obliquit : planet obliquity (deg)' … … 466 527 999 continue 467 528 468 c-----------------------------------------------------------------------469 cWrite values of physical constants after modifications470 c-----------------------------------------------------------------------529 !---------------------------------------------------------------------- 530 ! Write values of physical constants after modifications 531 !----------------------------------------------------------------------- 471 532 472 533 write(*,*) '*****************************************************' … … 509 570 ENDIF ! of if (Lmodif == 1) 510 571 511 c-----------------------------------------------------------------------512 cSave some constants for later use (as routine arguments)513 c-----------------------------------------------------------------------572 !----------------------------------------------------------------------- 573 ! Save some constants for later use (as routine arguments) 574 !----------------------------------------------------------------------- 514 575 p_omeg = omeg 515 576 p_g = g … … 520 581 521 582 522 end 583 END SUBROUTINE tabfi 584 585 end module tabfi_mod
Note: See TracChangeset
for help on using the changeset viewer.