Changeset 1146 for LMDZ4/trunk/libf/dyn3d/gcm.F
- Timestamp:
- Apr 9, 2009, 12:11:35 PM (15 years ago)
- Location:
- LMDZ4/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ4/trunk
-
Property
svn:mergeinfo
set to
/LMDZ4/branches/LMDZ4-dev merged eligible
-
Property
svn:mergeinfo
set to
-
LMDZ4/trunk/libf/dyn3d/gcm.F
r962 r1146 8 8 #ifdef CPP_IOIPSL 9 9 USE IOIPSL 10 #endif 10 #else 11 ! if not using IOIPSL, we still need to use (a local version of) getin 12 USE ioipsl_getincom 13 #endif 14 15 USE filtreg_mod 16 USE infotrac 11 17 12 18 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 14 20 ! A nettoyer. On ne veut qu'une ou deux routines d'interface 15 21 ! dynamique -> physique pour l'initialisation 16 #ifdef CPP_PHYS 22 ! Ehouarn: for now these only apply to Earth: 23 #ifdef CPP_EARTH 17 24 USE dimphy 18 25 USE comgeomphy … … 68 75 #include "iniprint.h" 69 76 #include "tracstoke.h" 70 #include "advtrac.h"71 77 72 78 INTEGER longcles … … 83 89 REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) ! vents covariants 84 90 REAL teta(ip1jmp1,llm) ! temperature potentielle 85 REAL q(ip1jmp1,llm,nqmx)! champs advectes91 REAL, ALLOCATABLE, DIMENSION(:,:,:):: q! champs advectes 86 92 REAL ps(ip1jmp1) ! pression au sol 87 93 REAL p (ip1jmp1,llmp1 ) ! pression aux interfac.des couches … … 137 143 c variables pour l'initialisation de la physique : 138 144 c ------------------------------------------------ 139 INTEGER ngridmx ,nq145 INTEGER ngridmx 140 146 PARAMETER( ngridmx = 2+(jjm-1)*iim - 1/jjm ) 141 147 REAL zcufi(ngridmx),zcvfi(ngridmx) … … 155 161 dynhistave_file = 'dyn_hist_ave.nc' 156 162 157 c initialisation Anne 158 hadv_flg(:) = 0. 159 vadv_flg(:) = 0. 160 conv_flg(:) = 0. 161 pbl_flg(:) = 0. 162 tracnam(:) = ' ' 163 nprath = 1 164 nbtrac = 0 165 mmt_adj(:,:,:,:) = 1 166 167 168 c-------------------------------------------------------------------------- 169 c Iflag_phys controle l'appel a la physique : 170 c ------------------------------------------- 171 c 0 : pas de physique 172 c 1 : Normale (appel a phylmd, phymars ...) 173 c 2 : rappel Newtonien pour la temperature + friction au sol 174 iflag_phys=1 175 176 c-------------------------------------------------------------------------- 177 c Lecture de l'etat initial : 178 c --------------------------- 179 c T : on lit start.nc 180 c F : le modele s'autoinitialise avec un cas academique (iniacademic) 181 read_start=.true. 182 #ifdef CPP_IOIPSL 183 #else 184 read_start=.false. 185 #endif 186 #ifdef CPP_PHYS 187 #else 188 read_start=.false. 189 #endif 163 190 164 191 165 c----------------------------------------------------------------------- … … 204 178 c --------------------------------------- 205 179 c 206 #ifdef CPP_IOIPSL 180 ! Ehouarn: dump possibility of using defrun 181 !#ifdef CPP_IOIPSL 207 182 CALL conf_gcm( 99, .TRUE. , clesphy0 ) 208 #else209 CALL defrun( 99, .TRUE. , clesphy0 )210 #endif183 !#else 184 ! CALL defrun( 99, .TRUE. , clesphy0 ) 185 !#endif 211 186 212 187 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 214 189 ! A nettoyer. On ne veut qu'une ou deux routines d'interface 215 190 ! dynamique -> physique pour l'initialisation 216 #ifdef CPP_PHYS 217 CALL Init_Phys_lmdz(iim,jjp1,llm,nqmx-2,1,(jjm-1)*iim+2) 191 ! Ehouarn : temporarily (?) keep this only for Earth 192 if (planet_type.eq."earth") then 193 #ifdef CPP_EARTH 194 CALL Init_Phys_lmdz(iim,jjp1,llm,1,(jjm-1)*iim+2) 218 195 call InitComgeomphy 219 196 #endif 197 endif 220 198 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 221 199 222 200 IF (config_inca /= 'none') THEN 223 201 #ifdef INCA 224 call init_const_lmdz(nbtr ac,anneeref,dayref,iphysiq,day_step,nday)202 call init_const_lmdz(nbtr,anneeref,dayref,iphysiq,day_step,nday) 225 203 call init_inca_para(iim,jjm+1,klon,1,klon_mpi_para_nb,0) 226 204 #endif … … 237 215 c Initialisation des traceurs 238 216 c --------------------------- 239 c Choix du schema pour l'advection 240 c dans fichier trac.def ou via INCA 241 242 call iniadvtrac(nq) 243 c 217 c Choix du nombre de traceurs et du schema pour l'advection 218 c dans fichier traceur.def, par default ou via INCA 219 call infotrac_init 220 221 c Allocation de la tableau q : champs advectes 222 allocate(q(ip1jmp1,llm,nqtot)) 223 244 224 c----------------------------------------------------------------------- 245 225 c Lecture de l'etat initial : … … 248 228 c lecture du fichier start.nc 249 229 if (read_start) then 250 #ifdef CPP_IOIPSL 251 CALL dynetat0("start.nc",nqmx,vcov,ucov, 230 ! we still need to run iniacademic to initialize some 231 ! constants & fields, if we run the 'newtonian' case: 232 if (iflag_phys.eq.2) then 233 CALL iniacademic(vcov,ucov,teta,q,masse,ps,phis,time_0) 234 endif 235 !#ifdef CPP_IOIPSL 236 if (planet_type.eq."earth") then 237 #ifdef CPP_EARTH 238 ! Load an Earth-format start file 239 CALL dynetat0("start.nc",vcov,ucov, 252 240 . teta,q,masse,ps,phis, time_0) 241 #endif 242 endif ! of if (planet_type.eq."earth") 253 243 c write(73,*) 'ucov',ucov 254 244 c write(74,*) 'vcov',vcov … … 257 247 c write(77,*) 'q',q 258 248 259 #endif 260 endif 249 endif ! of if (read_start) 261 250 262 251 IF (config_inca /= 'none') THEN … … 270 259 c le cas echeant, creation d un etat initial 271 260 IF (prt_level > 9) WRITE(lunout,*) 272 . 'AVANT iniacademic AVANT AVANT AVANT AVANT'261 . 'GCM: AVANT iniacademic AVANT AVANT AVANT AVANT' 273 262 if (.not.read_start) then 274 CALL iniacademic( nqmx,vcov,ucov,teta,q,masse,ps,phis,time_0)263 CALL iniacademic(vcov,ucov,teta,q,masse,ps,phis,time_0) 275 264 endif 276 265 … … 304 293 if (annee_ref .ne. anneeref .or. day_ref .ne. dayref) then 305 294 write(lunout,*) 306 . ' Attention les dates initiales lues dans le fichier'295 . 'GCM: Attention les dates initiales lues dans le fichier' 307 296 write(lunout,*) 308 297 . ' restart ne correspondent pas a celles lues dans ' … … 310 299 if (raz_date .ne. 1) then 311 300 write(lunout,*) 312 . ' On garde les dates du fichier restart'301 . 'GCM: On garde les dates du fichier restart' 313 302 else 314 303 annee_ref = anneeref … … 319 308 time_0 = 0. 320 309 write(lunout,*) 321 . ' On reinitialise a la date lue dans gcm.def'310 . 'GCM: On reinitialise a la date lue dans gcm.def' 322 311 endif 323 312 ELSE … … 356 345 c Initialisation de la physique : 357 346 c ------------------------------- 358 #ifdef CPP_PHYS 359 IF (call_iniphys.and. iflag_phys.eq.1) THEN347 348 IF (call_iniphys.and.(iflag_phys.eq.1)) THEN 360 349 latfi(1)=rlatu(1) 361 350 lonfi(1)=0. … … 376 365 CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,aire,airefi) 377 366 WRITE(lunout,*) 378 . 'WARNING!!! vitesse verticale nulle dans la physique' 367 . 'GCM: WARNING!!! vitesse verticale nulle dans la physique' 368 ! Earth: 369 if (planet_type.eq."earth") then 370 #ifdef CPP_EARTH 379 371 CALL iniphysiq(ngridmx,llm,daysec,day_ini,dtphys , 380 372 , latfi,lonfi,airefi,zcufi,zcvfi,rad,g,r,cpp ) 373 #endif 374 endif ! of if (planet_type.eq."earth") 381 375 call_iniphys=.false. 382 ENDIF 383 #endif376 ENDIF ! of IF (call_iniphys.and.(iflag_phys.eq.1)) 377 !#endif 384 378 385 379 c numero de stockage pour les fichiers de redemarrage: … … 392 386 day_end = day_ini + nday 393 387 WRITE(lunout,300)day_ini,day_end 388 300 FORMAT('1'/,15x,'run du jour',i7,2x,'au jour',i7//) 389 390 if (planet_type.eq."earth") then 391 #ifdef CPP_EARTH 392 CALL dynredem0("restart.nc", day_end, phis) 393 #endif 394 endif 395 396 ecripar = .TRUE. 394 397 395 398 #ifdef CPP_IOIPSL 396 CALL dynredem0("restart.nc", day_end, phis, nqmx)397 398 ecripar = .TRUE.399 400 399 if ( 1.eq.1) then 401 400 time_step = zdtvr … … 403 402 t_wrt = iecri * daysec 404 403 CALL inithist(dynhist_file,day_ref,annee_ref,time_step, 405 . t_ops, t_wrt, nqmx, histid, histvid) 406 407 t_ops = iperiod * time_step 408 t_wrt = periodav * daysec 409 CALL initdynav(dynhistave_file,day_ref,annee_ref,time_step, 410 . t_ops, t_wrt, nqmx, histaveid) 411 404 . t_ops, t_wrt, histid, histvid) 405 406 IF (ok_dynzon) THEN 407 t_ops = iperiod * time_step 408 t_wrt = periodav * daysec 409 CALL initdynav(dynhistave_file,day_ref,annee_ref,time_step, 410 . t_ops, t_wrt, histaveid) 411 END IF 412 412 dtav = iperiod*dtvr/daysec 413 413 endif … … 415 415 416 416 #endif 417 ! #endif of #ifdef CPP_IOIPSL 417 418 418 419 c Choix des frequences de stokage pour le offline … … 435 436 436 437 437 CALL leapfrog(ucov,vcov,teta,ps,masse,phis, nq,q,clesphy0,438 CALL leapfrog(ucov,vcov,teta,ps,masse,phis,q,clesphy0, 438 439 . time_0) 439 440 440 441 442 300 FORMAT('1'/,15x,'run du pas',i7,2x,'au pas',i7,2x,443 . 'c''est a dire du jour',i7,3x,'au jour',i7//)444 441 END 445 442
Note: See TracChangeset
for help on using the changeset viewer.