Changeset 2868 for trunk/WRF.COMMON/INTERFACES_V4/module_lmd_driver.F
- Timestamp:
- Jan 16, 2023, 4:47:08 PM (23 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.