Changeset 2868
- Timestamp:
- Jan 16, 2023, 4:47:08 PM (23 months ago)
- Location:
- trunk/WRF.COMMON/INTERFACES_V4
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WRF.COMMON/INTERFACES_V4/dynphy_wrf_generic_lmd/callphysiq_mod.F
r2866 r2868 43 43 44 44 call allocate_comm_wrf(klon,llm) 45 46 45 ! Call physics package with required inputs/outputs 47 46 CALL physiq(klon, & ! ngrid 48 47 llm, & ! nlayer 49 48 nqtot, & ! nq 50 ! noms, & ! nametrac51 49 debut_split, & ! firstcall 52 50 lafin_split, & ! lastcall -
trunk/WRF.COMMON/INTERFACES_V4/dynphy_wrf_generic_lmd/update_inputs_physiq_mod.F
r2866 r2868 27 27 REAL :: sec,nsec 28 28 29 IF (JULYR .le. 8999) THEN30 if (tlocked .eqv. .false.) THEN29 !IF (JULYR .le. 8999) THEN 30 ! if (tlocked .eqv. .false.) THEN 31 31 JH_cur_split = (GMT + elaps/3600.) !! universal time (0<JH_cur_split<1): JH_cur_split=0.5 at 12:00 UT 32 32 JH_cur_split = MODULO(JH_cur_split,24.) !! the two arguments of MODULO must be of the same type … … 36 36 MY = (JULYR-2000) + (86400*(JULDAY - 1)+3600.0*GMT+elaps)/31968000 37 37 MY = INT(MY) 38 ELSE 39 JH_cur_split = (GMT)! + elaps/420000.) !! universal time (0<JH_cur_split<1): JH_cur_split=0.5 at 12:00 UT 40 JH_cur_split = MODULO(JH_cur_split,24.) !! the two arguments of MODULO must be of the same type 41 JH_cur_split = JH_cur_split / 24. 42 JD_cur = (JULDAY - 1 + INT((3600*GMT)/86400))!+elaps)/1.008e7)) 43 JD_cur = MODULO(int(JD_cur),2) 44 MY = (JULYR-2000) + (86400*(JULDAY - 1)+3600*GMT+elaps)/31968000 45 MY = INT(MY) 46 ENDIF 47 ELSE 48 if (tlocked .eqv. .false.) THEN 49 JH_cur_split = lct_input - lon_input / 15. + elaps/1500.0 50 JD_cur = INT((sec*(lct_input - lon_input / 15.) + elaps)/36000) 51 !ptime = lct_input - lon_input / 15. + elaps/3600. 52 !pday = INT((3600*(lct_input - lon_input / 15.) + elaps)/86400) 53 ELSE 54 JH_cur_split = lct_input - lon_input / 15. !+ elaps/1500.0 55 !pday = INT((sec*(lct_input - lon_input / 15.)+ elaps)/36000) 56 JD_cur = INT((sec*(lct_input - lon_input / 15.))/3600) 57 !print*,'ptime',ptime 58 !print*,'pday',pday 59 !pday = INT((3600*(lct_input - lon_input / 15.) + elaps)/86400) 60 JH_cur_split = MODULO(ptime,24.) 61 JH_cur_split = JH_cur_split / 24. 62 JD_cur = MODULO(int(pday),365) 63 MY = 2024 64 ENDIF 65 ENDIF 38 ! ELSE 39 ! JH_cur_split = (GMT)! + elaps/420000.) !! universal time (0<JH_cur_split<1): JH_cur_split=0.5 at 12:00 UT 40 ! JH_cur_split = MODULO(JH_cur_split,24.) !! the two arguments of MODULO must be of the same type 41 ! JH_cur_split = JH_cur_split / 24. 42 ! JD_cur = (JULDAY - 1 + INT((3600*GMT)/86400))!+elaps)/1.008e7)) 43 ! JD_cur = MODULO(int(JD_cur),2) 44 ! MY = (JULYR-2000) + (86400*(JULDAY - 1)+3600*GMT+elaps)/31968000 45 ! MY = INT(MY) 46 ! ENDIF 47 !ELSE 48 ! if (tlocked .eqv. .false.) THEN 49 ! JH_cur_split = lct_input - lon_input / 15. + elaps/1500.0 50 ! JD_cur = INT((sec*(lct_input - lon_input / 15.) + elaps)/36000) 51 ! !ptime = lct_input - lon_input / 15. + elaps/3600. 52 ! !pday = INT((3600*(lct_input - lon_input / 15.) + elaps)/86400) 53 ! ELSE 54 ! JH_cur_split = lct_input - lon_input / 15. !+ elaps/1500.0 55 ! !pday = INT((sec*(lct_input - lon_input / 15.)+ elaps)/36000) 56 ! JD_cur = INT((sec*(lct_input - lon_input / 15.))/3600) 57 ! !print*,'ptime',ptime 58 ! !print*,'pday',pday 59 ! !pday = INT((3600*(lct_input - lon_input / 15.) + elaps)/86400) 60 ! JH_cur_split = MODULO(ptime,24.) 61 ! JH_cur_split = JH_cur_split / 24. 62 ! JD_cur = MODULO(int(pday),365) 63 ! MY = 2024 64 ! ENDIF 65 !ENDIF 66 66 67 67 68 END SUBROUTINE update_inputs_physiq_time … … 80 81 81 82 !! tableau dans tracer_mod.F90 82 nqtot=nq83 83 if ((TRACER_MODE .eq. 1) .or. (TRACER_MODE .ge. 42)) THEN 84 84 nqtot=2 … … 107 107 SUBROUTINE update_inputs_physiq_constants 108 108 109 !USE module_model_constants110 !use comcstfi_h, only: omeg,mugaz111 !use planete_h, only: year_day,periheli,aphelie, &112 ! peri_day,obliquit,emin_turb, &113 ! lmixmin114 109 use planete_mod, only: year_day, periastr, apoastr, peri_day,& 115 110 obliquit, z0, lmixmin, emin_turb … … 117 112 emisice,dtemisice 118 113 ! z0_default 119 !use comsoil_h, only: volcapa120 114 use comcstfi_mod, only: rad, omeg, g, mugaz, rcp, cpp, r 121 !! comcstfi_h122 115 use phys_state_var_mod, only :cloudfrac,totcloudfrac,hice,rnat,pctsrf_sic,tsea_ice 123 !use iniorbit 124 !use time_phylmdz_mod, only: dtphys, daysec,day_ini 125 126 127 !open(17,file='controle.txt',form='formatted',status='old') 128 !rewind(17) 129 !read(17,*) 130 !read(17,*) 131 !read(17,*) day_ini !(tab0+3) 132 !read(17,*) 133 !read(17,*) !tab0+5) 134 !read(17,*) omeg !(tab0+6) 135 !read(17,*) !(tab0+7) 136 !read(17,*) !(tab0+8) 137 !read(17,*) !(tab0+9) 138 !read(17,*) daysec 139 !read(17,*) dtphys !tab0+11) 140 !read(17,*) 141 !read(17,*) 142 !read(17,*) year_day !(tab0+14) 143 !read(17,*) periastr !tab0+15) 144 !read(17,*) apoastr !tab0+16) 145 !read(17,*) peri_day !tab0+17) 146 !read(17,*) obliquit !tab0+18) 147 !read(17,*) z0 148 !read(17,*) 149 !read(17,*) 150 !read(17,*) 151 !read(17,*) 152 !read(17,*) emisice(1) 153 !read(17,*) emisice(2) 154 !read(17,*) emissiv 155 !read(17,*) 156 !read(17,*) 157 !read(17,*) 158 !read(17,*) 159 !read(17,*) iceradius(1) 160 !read(17,*) iceradius(2) 161 !read(17,*) dtemisice(1) 162 !read(17,*) dtemisice(2) 163 !close(17) 164 !cpp=(8.314511/(mugaz/1000.0))/rcp 165 !print*,'cpp',cpp 166 !print*,'g',g 167 168 !emissiv(:)=EMIS 169 !cloudfrac(:,:)=0.5 170 !totcloudfrac(:)=0.5 171 !hice(:)=0. 172 !rnat(:)=0. 173 !pctsrf_sic(:)=0. 174 !tsea_ice(:)=0. 175 !qsurf(:,:) = 0. 176 !print*,'iceradius',iceradius,'dtemisice',dtemisice 177 !print*,'apoastr,periastr,year_day,peri_day,obliq',apoastr,periastr,year_day,peri_day,obliquit 178 !print*,'emissiv',emissiv 179 180 ! SUBROUTINE iniorbit(apoastr,periastr,year_day,peri_day,obliq) 181 116 !JL22 this routine does not do anything for the generic interface 117 ! The various use abave can surely be removed. 182 118 END SUBROUTINE update_inputs_physiq_constants 183 119 … … 272 208 latitude_deg(:) = plat(:)/DEGRAD 273 209 cell_area(:) = parea(:) 274 !call planetwide_sumval(parea,totarea_planet)275 !print*,'parea',parea(1)276 !totarea=SSUM(ngrid,parea,1)277 210 totarea=ngrid*parea(1) 278 !totarea_planet=SSUM(ngrid,parea,1)279 211 totarea_planet=ngrid*parea(1) 280 212 … … 294 226 DO k=1, nlayer 295 227 read(12,*) znw(k) 296 !write(6,*) 'read level ', k,grid%znw(k)297 228 ENDDO 298 229 close(12) … … 319 250 JULYR,TRACER_MODE,& 320 251 M_ALBEDO,CST_AL,& 321 M_TSURF,M_EMISS,M_CO2ICE,&252 P_TSURF,M_EMISS,M_CO2ICE,& 322 253 M_GW,M_Z0,CST_Z0,& 323 254 M_H2OICE,& … … 335 266 REAL, INTENT(IN ) :: CST_AL, phisfi_val, CST_Z0 336 267 REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN) :: & 337 M_ALBEDO, M_TSURF,M_EMISS,M_CO2ICE,M_H2OICE,M_Z0268 M_ALBEDO,P_TSURF,M_EMISS,M_CO2ICE,M_H2OICE,M_Z0 338 269 REAL, DIMENSION( ims:ime, 5, jms:jme ), INTENT(IN ) :: M_GW 339 270 340 !print*,'ALLOCATED(phisfi)',ALLOCATED(phisfi)341 !print*,'size phisfi',size(phisfi)342 271 DO j = jps,jpe 343 272 DO i = ips,ipe … … 352 281 !---------------------! 353 282 phisfi(subs) = phisfi_val 354 ! print*,'size phisfi',size(phisfi)355 !print*,'phisfi',phisfi(subs)356 283 !---------------! 357 284 ! Ground albedo ! … … 383 310 !----------------------------! 384 311 z0 = CST_Z0 385 !IF (JULYR .le. 8999) THEN 386 ! IF (CST_Z0 == 0) THEN 387 ! z0(subs) = M_Z0(i,j) 388 ! ELSE 389 ! z0(subs) = CST_Z0 390 ! IF ( (i == ips) .AND. (j == jps) ) PRINT *,'** Mars ** SET CONSTANT SURF ROUGHNESS (m) ',CST_Z0 391 ! ENDIF 392 !ELSE 393 ! IF ( (i == ips) .AND. (j == jps) ) PRINT *,'** Mars ** IDEALIZED SIMULATION z0 (m) ', CST_Z0 394 ! z0(subs)=CST_Z0 395 !ENDIF 396 !!!!! ADDITIONAL SECURITY. THIS MIGHT HAPPEN WITH OLD INIT FILES. 397 !IF (z0(subs) == 0.) THEN 398 ! IF ( (i == ips) .AND. (j == jps) ) PRINT *, 'WELL, z0 is 0, this is no good. Setting to old defaults value 0.01 m' 399 ! z0(subs) = 0.01 400 !ENDIF 401 !!!!! ADDITIONAL SECURITY. INTERP+SMOOTH IN GEOGRID MIGHT YIELD NEGATIVE Z0 !!! 402 !IF (z0(subs) < 0.) THEN 403 ! PRINT *, 'WELL, z0 is NEGATIVE, this is impossible. better stop here.' 404 ! PRINT *, 'advice --> correct interpolation / smoothing of z0 in WPS' 405 ! PRINT *, ' -- or check the constant value set in namelist.input' 406 ! STOP 407 !ENDIF 408 312 409 313 !-----------------------------------------------! 410 314 ! Ground temperature, emissivity, CO2 ice cover ! 411 315 !-----------------------------------------------! 412 tsurf(subs) = M_TSURF(i,j)316 tsurf(subs) = P_TSURF(i,j) 413 317 emis(subs) = M_EMISS(i,j) 414 318 !do i=1,noceanmx … … 466 370 M_TI,CST_TI,& 467 371 M_ISOIL,M_DSOIL,& 468 M_TSOIL, M_TSURF)372 M_TSOIL,P_TSURF) 469 373 470 374 use comsoil_h, only: inertiedat,mlayer,layer,volcapa … … 476 380 REAL, INTENT(IN ) :: CST_TI 477 381 REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN) :: & 478 M_TI, M_TSURF382 M_TI, P_TSURF 479 383 REAL, DIMENSION( ims:ime, nsoil, jms:jme ), INTENT(IN) :: & 480 384 M_TSOIL, M_ISOIL, M_DSOIL … … 541 445 IF ( (i == ips) .AND. (j == jps) ) PRINT *,'** Mars ** no tsoil. set it to tsurf.' 542 446 do k=1,nsoil 543 !print*,'M_TSURF(i,j)',M_TSURF(1,:) 544 !print*,'size M_TSURF',size(M_TSURF) 545 !print*,'size tsoil',size(tsoil) 546 tsoil(subs,k) = M_TSURF(i,j) 547 !print*,'tsoil(subs,k)',tsoil(subs,k) 447 tsoil(subs,k) = P_TSURF(i,j) 548 448 enddo 549 449 ENDIF -
trunk/WRF.COMMON/INTERFACES_V4/dynphy_wrf_generic_lmd/update_outputs_physiq_mod.F
r2866 r2868 9 9 ips,ipe,jps,jpe,& 10 10 TRACER_MODE,& 11 M_TSURF,M_CO2ICE,&11 P_TSURF,M_CO2ICE,& 12 12 M_H2OICE) 13 13 … … 20 20 INTEGER :: i,j,subs 21 21 REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: & 22 M_TSURF,M_CO2ICE,M_H2OICE23 24 DO j = jps,jpe 25 DO i = ips,ipe 26 27 !-----------------------------------! 28 ! 1D subscript for physics "cursor" ! 29 !-----------------------------------! 30 subs = (j-jps)*(ipe-ips+1)+(i-ips+1) 31 32 !-------------------------------------------------------! 33 ! Save key variables for restart and output and nesting ! 34 !-------------------------------------------------------! 35 M_TSURF(i,j) = tsurf(subs)22 P_TSURF,M_CO2ICE,M_H2OICE 23 24 DO j = jps,jpe 25 DO i = ips,ipe 26 27 !-----------------------------------! 28 ! 1D subscript for physics "cursor" ! 29 !-----------------------------------! 30 subs = (j-jps)*(ipe-ips+1)+(i-ips+1) 31 32 !-------------------------------------------------------! 33 ! Save key variables for restart and output and nesting ! 34 !-------------------------------------------------------! 35 P_TSURF(i,j) = tsurf(subs) 36 36 37 37 ENDDO -
trunk/WRF.COMMON/INTERFACES_V4/module_lmd_driver.F
r2866 r2868 26 26 P8W,DZ8W,T8W,Z,HT,MUT,DNW, & 27 27 U,V,TH,T,P,EXNER,RHO, & 28 P_HYD, P_HYD_W, & 28 29 PTOP, & 29 30 RADT, & … … 35 36 planet_type, & 36 37 M_ALBEDO,M_TI,M_CO2ICE,M_EMISS, & 37 M_H2OICE,M_TSOIL,M_Q2, M_TSURF, &38 M_H2OICE,M_TSOIL,M_Q2,P_TSURF, & 38 39 M_FLUXRAD,M_WSTAR,M_ISOIL,M_DSOIL,& 39 40 M_Z0, CST_Z0, M_GW, & … … 41 42 CST_AL, CST_TI, & 42 43 isfflx, diff_opt, km_opt, & 43 HISTORY_INTERVAL, & 44 HR_SW,HR_LW,HR_DYN,DDT,DT_RAD,DT_VDF,DT_AJS,& 44 HR_SW,HR_LW,HR_DYN,DDT,DT_RAD,DT_VDF,& 45 45 CLOUDFRAC,TOTCLOUDFRAC,RH, & 46 46 DQICE,DQVAP,REEVAP,SURFRAIN,ALBEQ,FLUXTOP_DN,FLUXABS_SW,FLUXTOP_LW,FLUXSURF_SW,& … … 94 94 REAL, INTENT(IN ) :: CST_AL, CST_TI 95 95 REAL, INTENT(IN ) :: PTOP 96 INTEGER, INTENT(IN ) :: HISTORY_INTERVAL97 96 ! 2D arrays 98 97 REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: & … … 103 102 SLPX,SLPY, & 104 103 M_CO2ICE,M_H2OICE, & 105 M_TSURF, M_Z0, &104 P_TSURF, M_Z0, & 106 105 M_FLUXRAD,M_WSTAR, & 107 106 PSFC,TSK … … 116 115 ! 3D arrays 117 116 REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(IN ) :: & 118 dz8w,p8w,p,exner,t,t8w,rho,u,v,z,th 117 dz8w,p8w,p,exner,t,t8w,rho,u,v,z,th,p_hyd,p_hyd_w 119 118 REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(OUT ) :: & 120 119 RTHBLTEN,RUBLTEN,RVBLTEN, & 121 HR_SW,HR_LW,HR_DYN,DDT,DT_RAD,DT_VDF, DT_AJS,RDUST,VMR_ICE,RICE,&120 HR_SW,HR_LW,HR_DYN,DDT,DT_RAD,DT_VDF,RDUST,VMR_ICE,RICE,& 122 121 CLOUDFRAC,RH,DQICE,DQVAP,DTLSC,DTRAIN,DT_MOIST,H2OICE_REFF 123 122 REAL, DIMENSION( ims:ime, kms:kme+1, jms:jme ), INTENT(INOUT ) :: & … … 156 155 ! <------ outputs: 157 156 ! physical tendencies 158 REAL*8,DIMENSION(:,:),ALLOCATABLE :: pdtheta159 157 ! ... intermediate arrays 160 158 REAL, DIMENSION(:), ALLOCATABLE :: & … … 171 169 LOGICAL, SAVE :: firstcall = .true. 172 170 INTEGER, SAVE :: previous_id = 0 173 !************************************************** 174 ! IMPORTANT: pour travailler avec grid nesting 175 ! --- deux comportements distincts du save 176 ! ... ex1: ferme planeto avec PGF+MPI: standard 177 ! ... ex2: iDataPlex avec IFORT+MPI: SPECIAL_NEST_SAVE 178 !************************************************** 179 #ifdef SPECIAL_NEST_SAVE 180 ! une dimension supplementaire liee au nest 181 REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: & 182 dp_save 183 REAL, DIMENSION(:,:,:), ALLOCATABLE, SAVE :: & 184 du_save, dv_save, dt_save,dtheta_save 185 REAL, DIMENSION(:,:,:,:), ALLOCATABLE, SAVE :: & 186 dq_save 187 #else 188 REAL, DIMENSION(:), ALLOCATABLE, SAVE :: & 189 dp_save 190 REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: & 191 du_save, dv_save, dt_save,dtheta_save 192 REAL, DIMENSION(:,:,:), ALLOCATABLE, SAVE :: & 193 dq_save 194 #endif 171 REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dp_save 172 REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: du_save, dv_save, dt_save 173 REAL, DIMENSION(:,:,:), ALLOCATABLE, SAVE :: dq_save 195 174 196 175 !!!IDEALIZED IDEALIZED … … 270 249 ! DIMENSIONS FOR THE PHYSICS ! 271 250 !----------------------------! 272 !day_ini = JULDAY - 1 !! GCM convention !! pday at firstcall is day_ini273 251 wappel_phys = RADT 274 252 zdt_split = dt*wappel_phys ! physical timestep (s) … … 282 260 lastcall = .false. 283 261 ! **** needed but hardcoded 284 285 !PRINT *, ips, ipe, jps, jpe286 !PRINT *, ngrid287 262 288 263 elaps = (float(itimestep)-1.)*dt ! elapsed seconds of simulation … … 300 275 !firstcall=.false. !! just in case you'd want to get rid of the physics 301 276 test=0 302 #ifdef SPECIAL_NEST_SAVE303 PRINT *, 'ALLOCATED dp_save ???', ALLOCATED( dp_save ), id304 IF( .NOT. ALLOCATED( dp_save ) ) THEN305 PRINT *, '**** check **** OK I ALLOCATE one save ARRAY for all NESTS ', max_dom, id306 !! here are the arrays that would be useful to save physics tendencies307 ALLOCATE(dp_save(ngrid,max_dom))308 ALLOCATE(du_save(ngrid,nlayer,max_dom))309 ALLOCATE(dv_save(ngrid,nlayer,max_dom))310 ALLOCATE(dt_save(ngrid,nlayer,max_dom))311 ALLOCATE(dtheta_save(ngrid,nlayer,max_dom))312 ALLOCATE(dq_save(ngrid,nlayer,nq,max_dom))313 dp_save(:,:)=0. !! initialize these arrays ...314 du_save(:,:,:)=0.315 dv_save(:,:,:)=0.316 dt_save(:,:,:)=0.317 dtheta_save(:,:,:)=0.318 dq_save(:,:,:,:)=0.319 ENDIF320 IF (id .lt. max_dom) THEN321 flag_first_restart=.true.322 ELSE323 flag_first_restart=.false.324 ENDIF325 #else326 277 IF( .NOT. ALLOCATED( dp_save ) ) THEN 327 278 ALLOCATE(dp_save(ngrid)) !! here are the arrays that would be useful to save physics tendencies … … 329 280 ALLOCATE(dv_save(ngrid,nlayer)) 330 281 ALLOCATE(dt_save(ngrid,nlayer)) 331 ALLOCATE(dtheta_save(ngrid,nlayer))332 282 ALLOCATE(dq_save(ngrid,nlayer,nq)) 333 283 ENDIF … … 336 286 dv_save(:,:)=0. 337 287 dt_save(:,:)=0. 338 dtheta_save(:,:)=0.339 288 dq_save(:,:,:)=0. 340 289 flag_first_restart=.false. 341 #endif 342 ELSE 290 291 ELSE ! is_first_step 343 292 !-------------------------------------------------! 344 293 ! what is done for the other steps of simulation ! … … 396 345 !----------! 397 346 CALL allocate_interface(ngrid,nlayer,nq) 398 ALLOCATE(pdtheta(ngrid,nlayer))399 347 !!! 400 348 !!! BIG LOOP : 1. no call for physics, used saved values … … 402 350 IF (test.NE.0) THEN 403 351 print *,'** ',planet_type,'** NO CALL FOR PHYSICS, go to next step...',test 404 #ifdef SPECIAL_NEST_SAVE405 zdpsrf_omp(:)=dp_save(:,id)406 zdufi_omp(:,:)=du_save(:,:,id)407 zdvfi_omp(:,:)=dv_save(:,:,id)408 zdtfi_omp(:,:)=dt_save(:,:,id)409 pdtheta(:,:)=dtheta_save(:,:,id)410 zdqfi_omp(:,:,:)=dq_save(:,:,:,id)411 #else412 352 print*,'else' 413 353 zdpsrf_omp(:)=dp_save(:) … … 415 355 zdvfi_omp(:,:)=dv_save(:,:) 416 356 zdtfi_omp(:,:)=dt_save(:,:) 417 pdtheta(:,:)=dtheta_save(:,:)418 357 zdqfi_omp(:,:,:)=dq_save(:,:,:) 419 #endif420 358 !!! 421 359 !!! BIG LOOP : 2. calculate physical tendencies 422 360 !!! 423 ELSE 361 ELSE ! if (test.EQ.0) 424 362 !----------! 425 363 ! ALLOCATE ! … … 489 427 !--------------------------------------! 490 428 dz8w_prof(:) = dz8w(i,kps:kpe,j) ! dz between full levels (m) 491 !p_prof(:) = p(i,kps:kpe,j) ! pressure half level (Pa) >> zplay_omp 429 p_prof(:) = p_hyd(i,kps:kpe,j) ! hydrostatic pressure at layers >> zplay_omp 430 p8w_prof(:) = p_hyd_w(i,kps:kpe+1,j) ! hydrostatic pressure at levels 431 !JL22 using hydrostatic pressures to conserve mass 492 432 t_prof(:) = t(i,kps:kpe,j) ! temperature half level (K) >> pt 493 433 t8w_prof(:) = t8w(i,kps:kpe,j) ! temperature full level (K) … … 495 435 v_prof(:) = v(i,kps:kpe,j) ! meridional wind (A-grid: unstaggered) half level (m/s) >> pv 496 436 z_prof(:) = z(i,kps:kpe,j) ! geopotential height half level (m) >> zphi_omp/g 497 498 499 !------------------------------------------------------------!500 ! reconstructing hydrostatic level pressure to conserve mass !501 !------------------------------------------------------------!502 p8w_prof(kpe+1) = ptop503 if (TRACER_MODE .ge. 42) then504 do k=kpe,kps,-1505 p8w_prof(k) = p8w_prof(k+1) - dnw(k) * mut(i,j) * (1.d0 + moist(i,k,j,P_QV))506 p_prof(k) = 0.5d0*(p8w_prof(k+1)+p8w_prof(k)) ! pressure half level (Pa) >> zplay_omp507 enddo508 else509 do k=kpe,kps,-1510 p8w_prof(k) = p8w_prof(k+1) - dnw(k) * mut(i,j)511 p_prof(k) = 0.5d0*(p8w_prof(k+1)+p8w_prof(k)) ! pressure half level (Pa) >> zplay_omp512 enddo513 endif514 !p8w_prof(:) = p8w(i,kps:kpe,j) ! pressure full level (Pa) >> zplev_omp515 437 516 438 … … 644 566 M_TI,CST_TI,& 645 567 M_ISOIL,M_DSOIL,& 646 M_TSOIL, M_TSURF)568 M_TSOIL,P_TSURF) 647 569 !!! 648 570 CALL update_inputs_physiq_surf( & … … 651 573 JULYR,TRACER_MODE,& 652 574 M_ALBEDO,CST_AL,& 653 M_TSURF,M_EMISS,M_CO2ICE,&575 P_TSURF,M_EMISS,M_CO2ICE,& 654 576 M_GW,M_Z0,CST_Z0,& 655 577 M_H2OICE,& … … 678 600 !!!!!!!!!!!!!!!!!!!!!! 679 601 680 call_physics : IF (wappel_phys .ne. 0.) THEN681 602 !!! initialize tendencies (security) 682 603 zdpsrf_omp(:)=0. … … 684 605 zdvfi_omp(:,:)=0. 685 606 zdtfi_omp(:,:)=0. 686 pdtheta(:,:)=0.687 607 zdqfi_omp(:,:,:)=0. 608 609 call_physics : IF (wappel_phys .ne. 0.) THEN 688 610 !print *, '** ',planet_type,'** CALL TO LMD PHYSICS' 689 611 !!! … … 699 621 !!! 700 622 701 !! specific scenario. necessary to add the right amount of dust.702 #ifdef DUSTSTORM703 IF (firstcall .EQV. .true.) THEN704 zdqfi_omp(:,:,:) = zdqfi_omp(:,:,:) / dt705 ENDIF706 #endif707 708 IF (planet_type .eq. "venus" ) THEN709 DO j=jps,jpe710 DO i=ips,ipe711 do k=kps,kpe712 subs=(j-jps)*(ipe-ips+1)+(i-ips+1)713 tk1=(ztfi_omp(subs,k)**nu + nu*TT00**nu*log((p1000mb/zplay_omp(subs,k))**rcp))**(1/nu)714 tk2=((ztfi_omp(subs,k) + zdtfi_omp(subs,k))**nu + nu*TT00**nu*log((p1000mb/zplay_omp(subs,k))**rcp))**(1/nu)715 pdtheta(subs,k)=tk2-tk1716 enddo717 ENDDO718 ENDDO719 ENDIF720 721 !print *, '** ',planet_type,'** CALL TO LMD PHYSICS DONE'722 723 623 !---------------------------------------------------------------------------------! 724 624 ! PHYSIQ TENDENCIES ARE SAVED TO BE SPLIT WITHIN INTERMEDIATE DYNAMICAL TIMESTEPS ! 725 625 !---------------------------------------------------------------------------------! 726 #ifdef SPECIAL_NEST_SAVE727 dp_save(:,id)=zdpsrf_omp(:)728 du_save(:,:,id)=zdufi_omp(:,:)729 dv_save(:,:,id)=zdvfi_omp(:,:)730 dt_save(:,:,id)=zdtfi_omp(:,:)731 dtheta_save(:,:,id)=pdtheta(:,:)732 dq_save(:,:,:,id)=zdqfi_omp(:,:,:)733 #else734 626 dp_save(:)=zdpsrf_omp(:) 735 627 du_save(:,:)=zdufi_omp(:,:) 736 628 dv_save(:,:)=zdvfi_omp(:,:) 737 629 dt_save(:,:)=zdtfi_omp(:,:) 738 dtheta_save(:,:)=pdtheta(:,:)739 630 dq_save(:,:,:)=zdqfi_omp(:,:,:) 740 #endif741 631 742 632 !! OUTPUT OUTPUT OUTPUT … … 749 639 ips,ipe,jps,jpe,& 750 640 TRACER_MODE,& 751 M_TSURF,M_CO2ICE,&641 P_TSURF,M_CO2ICE,& 752 642 M_H2OICE) 753 643 !!! … … 812 702 813 703 ! zonal wind 814 RUBLTEN(i,kps:kpe,j) = zdufi_omp(subs,kps:kpe) 704 RUBLTEN(i,kps:kpe,j) = zdufi_omp(subs,kps:kpe) 815 705 ! meridional wind 816 706 RVBLTEN(i,kps:kpe,j) = zdvfi_omp(subs,kps:kpe) 817 707 ! potential temperature 818 708 ! (dT = dtheta * exner for isobaric coordinates or if pressure variations are negligible) 819 IF (planet_type .eq. "venus" ) THEN 820 RTHBLTEN(i,kps:kpe,j) = pdtheta(subs,kps:kpe) 821 ELSE 822 RTHBLTEN(i,kps:kpe,j) = zdtfi_omp(subs,kps:kpe) / exner(i,kps:kpe,j) 823 ENDIF 709 RTHBLTEN(i,kps:kpe,j) = zdtfi_omp(subs,kps:kpe) / exner(i,kps:kpe,j) 824 710 ! update surface pressure (cf CO2 cycle in physics) 825 711 ! here dt is needed … … 841 727 scalar(i,kps:kpe,j,P_QH2O_ICE)=scalar(i,kps:kpe,j,P_QH2O_ICE) & 842 728 +zdqfi_omp(subs,kps:kpe,2)*dt * (1.d0+moist(i,kps:kpe,j,P_QV)) 843 ! if you want to use this mode, RTHBLTEN should be corrected as below.844 ! we keep it like that for the moment for testing.729 ! if you want to use this mode, RTHBLTEN should be corrected as below. 730 ! we keep it like that for the moment for testing. 845 731 CASE(43) 846 732 moist(i,kps:kpe,j,P_QV)=moist(i,kps:kpe,j,P_QV) & … … 864 750 ENDDO 865 751 CALL deallocate_interface 866 DEALLOCATE(pdtheta)867 752 !!*****!! 868 753 !! END !!
Note: See TracChangeset
for help on using the changeset viewer.