Changeset 1670 for trunk/LMDZ.TITAN/libf
- Timestamp:
- Feb 21, 2017, 11:32:17 AM (8 years ago)
- Location:
- trunk/LMDZ.TITAN/libf
- Files:
-
- 5 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.TITAN/libf/dynphy_lonlat/phytitan/newstart.F
r1647 r1670 35 35 USE temps_mod, ONLY: day_ini 36 36 USE ener_mod, ONLY: etot0,ptot0,ztot0,stot0,ang0 37 use tabfi_mod, only: tabfi 37 38 use iniphysiq_mod, only: iniphysiq 39 use phyetat0_mod, only: phyetat0 38 40 implicit none 39 41 … … 337 339 write(*,*) 'Reading file STARTFI' 338 340 fichnom = 'startfi.nc' 339 CALL phyetat0 (ngridmx,llm,fichnom,tab0,Lmodif,nsoilmx,341 CALL phyetat0(.true.,ngridmx,llm,fichnom,tab0,Lmodif,nsoilmx, 340 342 . nqtot,day_ini,time, 341 343 . tsurf,tsoil,emis,q2,qsurf) -
trunk/LMDZ.TITAN/libf/dynphy_lonlat/phytitan/start2archive.F
r1647 r1670 35 35 USE temps_mod, ONLY: day_ini 36 36 USE iniphysiq_mod, ONLY: iniphysiq 37 use phyetat0_mod, only: phyetat0 37 38 implicit none 38 39 … … 214 215 215 216 216 CALL phyetat0 (ngridmx,llm,fichnom,0,Lmodif,nsoilmx,nqtot,217 CALL phyetat0(.true.,ngridmx,llm,fichnom,0,Lmodif,nsoilmx,nqtot, 217 218 . day_ini_fi,timefi, 218 219 . tsurf,tsoil,emis,q2,qsurf) -
trunk/LMDZ.TITAN/libf/phytitan/callkeys_mod.F90
r1668 r1670 74 74 !$OMP THREADPRIVATE(iscallphys) 75 75 76 ! do we read a startphy.nc file (default=.true.) 77 logical,save :: startphy_file=.true. 78 !$OMP THREADPRIVATE(startphy_file) 79 76 80 END MODULE callkeys_mod -
trunk/LMDZ.TITAN/libf/phytitan/inifis_mod.F90
r1648 r1670 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.TITAN/libf/phytitan/phyetat0_mod.F90
r1669 r1670 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) 4 11 5 12 13 use tabfi_mod, only: tabfi 6 14 USE tracer_h, ONLY: noms 7 15 USE surfdat_h, only: phisfi, albedodat, zmea, zstd, zsig, zgam, zthe … … 13 21 14 22 !====================================================================== 15 ! Auteur(s) Z.X. Li (LMD/CNRS) date: 1993081816 ! Adaptation à Mars : Yann Wanherdrick17 ! Objet: Lecture de l etat initial pour la physique18 !======================================================================19 #include "netcdf.inc"20 21 !======================================================================22 ! INTEGER nbsrf !Mars nbsrf a 1 au lieu de 423 ! PARAMETER (nbsrf=1) ! nombre de sous-fractions pour une maille24 !======================================================================25 23 ! Arguments: 26 24 ! --------- 27 25 ! inputs: 26 logical,intent(in) :: startphy_file ! .true. if reading start file 28 27 integer,intent(in) :: ngrid 29 28 integer,intent(in) :: nlayer … … 33 32 integer,intent(in) :: nsoil ! # of soil layers 34 33 integer,intent(in) :: nq 35 integer,intent( in) :: day_ini36 real,intent( in) :: time34 integer,intent(out) :: day_ini 35 real,intent(out) :: time 37 36 38 37 ! outputs: … … 71 70 INTEGER :: indextime=1 ! index of selected time, default value=1 72 71 logical :: found 72 73 character(len=8) :: modname="phyetat0" 73 74 74 75 ! … … 83 84 IF (.not. ALLOCATED(zthe)) ALLOCATE(zthe(ngrid)) 84 85 85 86 ! open physics initial state file: 87 call open_startphy(fichnom) 88 89 90 ! possibility to modify tab_cntrl in tabfi 91 write(*,*) 92 write(*,*) 'TABFI in phyeta0: Lmodif=',Lmodif," tab0=",tab0 93 call tabfi (ngrid,nid_start,Lmodif,tab0,day_ini,lmax,p_rad, & 86 if (startphy_file) then 87 ! open physics initial state file: 88 call open_startphy(fichnom) 89 90 ! possibility to modify tab_cntrl in tabfi 91 write(*,*) 92 write(*,*) 'TABFI in phyeta0: Lmodif=',Lmodif," tab0=",tab0 93 call tabfi (ngrid,nid_start,Lmodif,tab0,day_ini,lmax,p_rad, & 94 94 p_omeg,p_g,p_cpp,p_mugaz,p_daysec,time) 95 95 96 !c 97 !c Lecture des latitudes (coordonnees): 98 !c 99 ! ierr = NF_INQ_VARID (nid, "latitude", nvarid) 100 ! IF (ierr.NE.NF_NOERR) THEN 101 ! PRINT*, 'phyetat0: Le champ <latitude> est absent' 102 ! CALL abort 103 ! ENDIF 104 !#ifdef NC_DOUBLE 105 ! ierr = NF_GET_VARA_DOUBLE(nid,nvarid,sta,ngrid,lati) 106 !#else 107 ! ierr = NF_GET_VARA_REAL(nid,nvarid,sta,ngrid,lati) 108 !#endif 109 ! IF (ierr.NE.NF_NOERR) THEN 110 ! PRINT*, 'phyetat0: Lecture echouee pour <latitude>' 111 ! CALL abort 112 ! ENDIF 113 !c 114 !c Lecture des longitudes (coordonnees): 115 !c 116 ! ierr = NF_INQ_VARID (nid, "longitude", nvarid) 117 ! IF (ierr.NE.NF_NOERR) THEN 118 ! PRINT*, 'phyetat0: Le champ <longitude> est absent' 119 ! CALL abort 120 ! ENDIF 121 !#ifdef NC_DOUBLE 122 ! ierr = NF_GET_VARA_DOUBLE(nid,nvarid,sta,ngrid,long) 123 !#else 124 ! ierr = NF_GET_VARA_REAL(nid,nvarid,sta,ngrid,long) 125 !#endif 126 ! IF (ierr.NE.NF_NOERR) THEN 127 ! PRINT*, 'phyetat0: Lecture echouee pour <longitude>' 128 ! CALL abort 129 ! ENDIF 130 !c 131 !c Lecture des aires des mailles: 132 !c 133 ! ierr = NF_INQ_VARID (nid, "area", nvarid) 134 ! IF (ierr.NE.NF_NOERR) THEN 135 ! PRINT*, 'phyetat0: Le champ <area> est absent' 136 ! CALL abort 137 ! ENDIF 138 !#ifdef NC_DOUBLE 139 ! ierr = NF_GET_VARA_DOUBLE(nid,nvarid,sta,ngrid,area) 140 !#else 141 ! ierr = NF_GET_VARA_REAL(nid,nvarid,sta,ngrid,area) 142 !#endif 143 ! IF (ierr.NE.NF_NOERR) THEN 144 ! PRINT*, 'phyetat0: Lecture echouee pour <area>' 145 ! CALL abort 146 ! ENDIF 147 ! xmin = 1.0E+20 148 ! xmax = -1.0E+20 149 ! xmin = MINVAL(area) 150 ! xmax = MAXVAL(area) 151 ! PRINT*,'Aires des mailles <area>:', xmin, xmax 152 153 ! Load surface geopotential: 154 call get_field("phisfi",phisfi,found) 155 if (.not.found) then 156 write(*,*) "phyetat0: Failed loading <phisfi>" 157 call abort 158 else 159 write(*,*) "phyetat0: surface geopotential <phisfi> range:", & 160 minval(phisfi), maxval(phisfi) 161 endif 162 163 ! Load bare ground albedo: 164 call get_field("albedodat",albedodat,found) 165 if (.not.found) then 166 write(*,*) "phyetat0: Failed loading <albedodat>" 167 call abort 168 else 169 write(*,*) "phyetat0: Bare ground albedo <albedodat> range:", & 96 else ! "academic" initialization of planetary parameters via tabfi 97 call tabfi (ngrid,0,0,0,day_ini,lmax,p_rad, & 98 p_omeg,p_g,p_cpp,p_mugaz,p_daysec,time) 99 endif ! of if (startphy_file) 100 101 if (startphy_file) then 102 ! Load surface geopotential: 103 call get_field("phisfi",phisfi,found) 104 if (.not.found) then 105 call abort_physic(modname,"Failed loading <phisfi>",1) 106 endif 107 else 108 phisfi(:)=0 109 endif ! of if (startphy_file) 110 write(*,*) "phyetat0: surface geopotential <phisfi> range:", & 111 minval(phisfi), maxval(phisfi) 112 113 if (startphy_file) then 114 ! Load bare ground albedo: 115 call get_field("albedodat",albedodat,found) 116 if (.not.found) then 117 call abort_physic(modname,"Failed loading <albedodat>",1) 118 endif 119 else 120 albedodat(:)=0.5 ! would be better to read value from def file... 121 endif ! of if (startphy_file) 122 write(*,*) "phyetat0: Bare ground albedo <albedodat> range:", & 170 123 minval(albedodat), maxval(albedodat) 171 endif172 124 173 125 ! ZMEA 174 call get_field("ZMEA",zmea,found) 175 if (.not.found) then 176 write(*,*) "phyetat0: Failed loading <ZMEA>" 177 call abort 178 else 179 write(*,*) "phyetat0: <ZMEA> range:", & 126 if (startphy_file) then 127 call get_field("ZMEA",zmea,found) 128 if (.not.found) then 129 call abort_physic(modname,"Failed loading <ZMEA>",1) 130 endif 131 else 132 zmea(:)=0 133 endif ! of if (startphy_file) 134 write(*,*) "phyetat0: <ZMEA> range:", & 180 135 minval(zmea), maxval(zmea) 181 endif182 136 183 137 ! ZSTD 184 call get_field("ZSTD",zstd,found) 185 if (.not.found) then 186 write(*,*) "phyetat0: Failed loading <ZSTD>" 187 call abort 188 else 189 write(*,*) "phyetat0: <ZSTD> range:", & 138 if (startphy_file) then 139 call get_field("ZSTD",zstd,found) 140 if (.not.found) then 141 call abort_physic(modname,"Failed loading <ZSTD>",1) 142 endif 143 else 144 zstd(:)=0 145 endif ! of if (startphy_file) 146 write(*,*) "phyetat0: <ZSTD> range:", & 190 147 minval(zstd), maxval(zstd) 191 endif192 148 193 149 ! ZSIG 194 call get_field("ZSIG",zsig,found) 195 if (.not.found) then 196 write(*,*) "phyetat0: Failed loading <ZSIG>" 197 call abort 198 else 199 write(*,*) "phyetat0: <ZSIG> range:", & 150 if (startphy_file) then 151 call get_field("ZSIG",zsig,found) 152 if (.not.found) then 153 call abort_physic(modname,"Failed loading <ZSIG>",1) 154 endif 155 else 156 zsig(:)=0 157 endif ! of if (startphy_file) 158 write(*,*) "phyetat0: <ZSIG> range:", & 200 159 minval(zsig), maxval(zsig) 201 endif202 160 203 161 ! ZGAM 204 call get_field("ZGAM",zgam,found) 205 if (.not.found) then 206 write(*,*) "phyetat0: Failed loading <ZGAM>" 207 call abort 208 else 209 write(*,*) "phyetat0: <ZGAM> range:", & 162 if (startphy_file) then 163 call get_field("ZGAM",zgam,found) 164 if (.not.found) then 165 call abort_physic(modname,"Failed loading <ZGAM>",1) 166 endif 167 else 168 zgam(:)=0 169 endif ! of if (startphy_file) 170 write(*,*) "phyetat0: <ZGAM> range:", & 210 171 minval(zgam), maxval(zgam) 211 endif212 172 213 173 ! ZTHE 214 call get_field("ZTHE",zthe,found) 215 if (.not.found) then 216 write(*,*) "phyetat0: Failed loading <ZTHE>" 217 call abort 218 else 219 write(*,*) "phyetat0: <ZTHE> range:", & 174 if (startphy_file) then 175 call get_field("ZTHE",zthe,found) 176 if (.not.found) then 177 call abort_physic(modname,"Failed loading <ZTHE>",1) 178 endif 179 else 180 zthe(:)=0 181 endif ! of if (startphy_file) 182 write(*,*) "phyetat0: <ZTHE> range:", & 220 183 minval(zthe), maxval(zthe) 221 endif222 184 223 185 ! Surface temperature : 224 call get_field("tsurf",tsurf,found,indextime) 225 if (.not.found) then 226 write(*,*) "phyetat0: Failed loading <tsurf>" 227 call abort 228 else 229 write(*,*) "phyetat0: Surface temperature <tsurf> range:", & 186 if (startphy_file) then 187 call get_field("tsurf",tsurf,found,indextime) 188 if (.not.found) then 189 call abort_physic(modname,"Failed loading <tsurf>",1) 190 endif 191 else 192 tsurf(:)=0 ! will be updated afterwards in physiq ! 193 endif ! of if (startphy_file) 194 write(*,*) "phyetat0: Surface temperature <tsurf> range:", & 230 195 minval(tsurf), maxval(tsurf) 231 endif232 196 233 197 ! Surface emissivity 234 call get_field("emis",emis,found,indextime) 235 if (.not.found) then 236 write(*,*) "phyetat0: Failed loading <emis>" 237 call abort 238 else 239 write(*,*) "phyetat0: Surface emissivity <emis> range:", & 198 if (startphy_file) then 199 call get_field("emis",emis,found,indextime) 200 if (.not.found) then 201 call abort_physic(modname,"Failed loading <emis>",1) 202 endif 203 else 204 emis(:)=1 ! would be better to read value from def file... 205 endif ! of if (startphy_file) 206 write(*,*) "phyetat0: Surface emissivity <emis> range:", & 240 207 minval(emis), maxval(emis) 241 endif242 208 243 209 ! pbl wind variance 244 call get_field("q2",q2,found,indextime) 245 if (.not.found) then 246 write(*,*) "phyetat0: Failed loading <q2>" 247 call abort 248 else 249 write(*,*) "phyetat0: PBL wind variance <q2> range:", & 210 if (startphy_file) then 211 call get_field("q2",q2,found,indextime) 212 if (.not.found) then 213 call abort_physic(modname,"Failed loading <q2>",1) 214 endif 215 else 216 q2(:,:)=0 217 endif ! of if (startphy_file) 218 write(*,*) "phyetat0: PBL wind variance <q2> range:", & 250 219 minval(q2), maxval(q2) 251 endif252 220 253 221 ! tracer on surface … … 255 223 do iq=1,nq 256 224 txt=noms(iq) 257 258 !! There was a bug here. MT2015. 259 260 !if (txt.eq."h2o_vap") then 261 ! There is no surface tracer for h2o_vap; 262 ! "h2o_ice" should be loaded instead 263 ! txt="h2o_ice" 264 ! write(*,*) 'phyetat0: loading surface tracer', & 265 ! ' h2o_ice instead of h2o_vap' 266 !endif 267 268 call get_field(txt,qsurf(:,iq),found,indextime) 269 if (.not.found) then 270 write(*,*) "phyetat0: Failed loading <",trim(txt),">" 271 write(*,*) " ",trim(txt)," is set to zero" 272 qsurf(:,iq) = 0. 225 if (startphy_file) then 226 call get_field(txt,qsurf(:,iq),found,indextime) 227 if (.not.found) then 228 write(*,*) "phyetat0: Failed loading <",trim(txt),">" 229 write(*,*) " ",trim(txt)," is set to zero" 230 qsurf(:,iq) = 0. 231 endif 273 232 else 274 write(*,*) "phyetat0: Surface tracer <",trim(txt),"> range:", & 233 qsurf(:,iq)=0 234 endif ! of if (startphy_file) 235 write(*,*) "phyetat0: Surface tracer <",trim(txt),"> range:", & 275 236 minval(qsurf(:,iq)), maxval(qsurf(:,iq)) 276 endif 277 enddo 237 enddo! of do iq=1,nq 278 238 endif ! of if (nq.ge.1) 279 239 280 240 281 ! Call to soil_settings, in order to read soil temperatures, 282 ! as well as thermal inertia and volumetric heat capacity 283 call soil_settings(nid_start,ngrid,nsoil,tsurf,tsoil,indextime) 241 if (startphy_file) then 242 ! Call to soil_settings, in order to read soil temperatures, 243 ! as well as thermal inertia and volumetric heat capacity 244 call soil_settings(nid_start,ngrid,nsoil,tsurf,tsoil,indextime) 245 endif ! of if (startphy_file) 284 246 ! 285 247 ! close file: 286 248 ! 287 call close_startphy 288 289 END SUBROUTINE phyetat0 249 if (startphy_file) call close_startphy 250 251 end subroutine phyetat0 252 253 end module phyetat0_mod -
trunk/LMDZ.TITAN/libf/phytitan/physiq_mod.F90
r1668 r1670 25 25 alpha_lift, alpha_devil, qextrhor 26 26 use time_phylmdz_mod, only: ecritphy, iphysiq, nday 27 use phyetat0_mod, only: phyetat0 27 28 use phyredem, only: physdem0, physdem1 28 29 use planetwide_mod, only: planetwide_minval,planetwide_maxval,planetwide_sumval … … 146 147 ! ------------------ 147 148 148 #include "netcdf.inc"149 include "netcdf.inc" 149 150 150 151 ! Arguments : … … 225 226 real pw(ngrid,nlayer) ! Vertical velocity (m/s). (NOTE : >0 WHEN DOWNWARDS !!) 226 227 227 integer l,ig,ierr,iq,nw 228 integer l,ig,ierr,iq,nw,isoil 228 229 229 230 ! FOR DIAGNOSTIC : … … 432 433 ! Read 'startfi.nc' file. 433 434 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 434 call phyetat0(ngrid,nlayer,"startfi.nc",0,0,nsoilmx,nq, & 435 call phyetat0(startphy_file, & 436 ngrid,nlayer,"startfi.nc",0,0,nsoilmx,nq, & 435 437 day_ini,time_phys,tsurf,tsoil,emis,q2,qsurf) 438 if (.not.startphy_file) then 439 ! additionnal "academic" initialization of physics 440 if (is_master) write(*,*) "Physiq: initializing tsurf(:) to pt(:,1) !!" 441 tsurf(:)=pt(:,1) 442 if (is_master) write(*,*) "Physiq: initializing tsoil(:) to pt(:,1) !!" 443 do isoil=1,nsoilmx 444 tsoil(1:ngrid,isoil)=tsurf(1:ngrid) 445 enddo 446 if (is_master) write(*,*) "Physiq: initializing day_ini to pdat !" 447 day_ini=pday 448 endif 436 449 437 450 if (pday.ne.day_ini) then -
trunk/LMDZ.TITAN/libf/phytitan/tabfi_mod.F90
r1669 r1670 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.