Changeset 2628 for trunk/LMDZ.MARS/libf/phymars/topmons_mod.F90
- Timestamp:
- Feb 28, 2022, 6:46:07 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/phymars/topmons_mod.F90
r2616 r2628 2 2 3 3 IMPLICIT NONE 4 5 ! sub-grid scale mountain mesh fraction6 REAL, SAVE, ALLOCATABLE :: alpha_hmons(:)7 8 !$OMP THREADPRIVATE(alpha_hmons)9 4 10 5 CONTAINS … … 32 27 clearsky,totcloudfrac, & 33 28 ! input sub-grid scale mountain 34 nohmons, hsummit,&29 nohmons, & 35 30 ! output 36 31 pdqtop,wfin,dsodust,dsords,dsotop, & … … 43 38 USE dimradmars_mod, only: albedo,naerkind 44 39 USE comsaison_h, only: dist_sol,mu0,fract 45 USE surfdat_h, only: emis,co2ice,hmons,summit 40 USE surfdat_h, only: emis,co2ice,hmons,summit,alpha_hmons, & 41 hsummit,contains_mons 46 42 USE callradite_mod, only: callradite 47 43 … … 87 83 ! input sub-grid scale mountain 88 84 LOGICAL, INTENT(IN) :: nohmons 89 REAL, INTENT(IN) :: hsummit(ngrid)90 85 91 86 !-------------------------------------------------------- … … 196 191 197 192 ! Detrainment 198 REAL coefdetrain(ngrid,nlayer) ! coefficient for detrainment : % of stormdust detrained193 REAL coefdetrain(ngrid,nlayer) ! coefficient for detrainment : % of topdust detrained 199 194 REAL dqdet_topdust_mass(ngrid,nlayer) ! tendancy pdq topdust mass after detrainment only 200 195 REAL dqdet_topdust_number(ngrid,nlayer) ! tendancy pdq topdust number after detrainment only … … 206 201 ! ********************************************************************** 207 202 ! ********************************************************************** 208 ! Parametrization of the entrainment by slope wind above the sub-grid209 ! scale topography203 ! Parametrization of the entrainment of dust by slope winds above the 204 ! converging sub-grid scale topography ("mountain top dust flows") 210 205 ! ********************************************************************** 211 206 ! ********************************************************************** … … 279 274 ! 1.1. Call the second radiative transfer for topdust, obtain the extra heating 280 275 ! ********************************************************************* 276 277 ! NB: since the only grid meshes that matter for the radiative transfer 278 ! are the ones that contain a mount (contains_mons(ig)=.true.), 279 ! it could be relevant to optimize the code by calling the RT 280 ! only for those grid meshes. 281 ! See Ticket #92 on trac.lmd.jussieu.fr/Planeto 281 282 CALL callradite(icount,ngrid,nlayer,nq,zday,zls,zq,albedo, & 282 283 emis,mu0,pplev,pplay,pt,tsurf,fract,dist_sol,igout, & … … 285 286 tau,aerosol,dsodust,tauscaling,dust_rad_adjust, & 286 287 taucloudtes,rdust,rice,nuice,riceco2,nuiceco2,co2ice,rstormdust,rtopdust, & 287 totstormfract,clearatm,dsords,dsotop, alpha_hmons,nohmons,&288 totstormfract,clearatm,dsords,dsotop,nohmons,& 288 289 clearsky,totcloudfrac) 289 290 ! ********************************************************************** … … 291 292 ! ********************************************************************** 292 293 DO ig=1,ngrid 293 IF ( (mu0(ig) .gt. mu0lim) .and. (alpha_hmons(ig) .gt. 0.) ) THEN 294 IF ( (mu0(ig) .gt. mu0lim) .and. (contains_mons(ig)) ) THEN 295 !! mu0(ig)>mu0lim ensures that it is daytime 296 !! contains_mons=True ensures that there is a mount in the mesh and alpha_hmons>0 297 294 298 !! ********************************************************************** 295 299 !! Temperature profile above the mountain and in the close environment … … 353 357 endif 354 358 ENDDO 355 ENDIF ! IF ((mu0(ig) .gt. mu0lim) .and. alpha_hmons(ig) .gt. 0.)359 ENDIF ! IF ((mu0(ig) .gt. mu0lim) .and. contains_mons(ig)) 356 360 ENDDO ! DO ig=1,ngrid 357 361 … … 364 368 ! ********************************************************************** 365 369 DO ig=1,ngrid 366 IF ( (mu0(ig) .gt. mu0lim) .and. ( alpha_hmons(ig) .gt. 0.) ) THEN370 IF ( (mu0(ig) .gt. mu0lim) .and. (contains_mons(ig)) ) THEN 367 371 !! Positive buoyancy: negative vertical velocity entrains UP 368 372 IF (dt_top(ig) .gt. 0.) THEN … … 477 481 478 482 DO ig=1,ngrid 479 IF ( (mu0(ig) .gt. mu0lim) .and. ( alpha_hmons(ig) .gt. 0.) ) THEN483 IF ( (mu0(ig) .gt. mu0lim) .and. (contains_mons(ig)) ) THEN 480 484 !! Total air mass within the PBL before entrainment (=> by PBL we mean between the surface and the layer where the vertical wind is maximum) 481 485 masse_pbl(ig)=0. … … 489 493 ! ********************************************************************** 490 494 DO ig=1,ngrid 491 IF ( (mu0(ig) .gt. mu0lim) .and. ( alpha_hmons(ig) .gt. 0.) .and. (masse_pbl(ig) .gt. 0.) ) THEN495 IF ( (mu0(ig) .gt. mu0lim) .and. (contains_mons(ig)) .and. (masse_pbl(ig) .gt. 0.) ) THEN 492 496 !! Transport of background dust + concentrated topdust above lwmax 493 497 DO l=lwmax(ig),nlayer … … 583 587 DO l=1,nlayer!-1 584 588 !! Detrainment during the day 585 IF ( (mu0(ig) .gt. mu0lim) .and. (zq_topdust_mass(ig,l) .gt. zq_dust_mass(ig,l)*0.01) ) THEN589 IF ( (mu0(ig) .gt. mu0lim) .and. (zq_topdust_mass(ig,l) .gt. zq_dust_mass(ig,l)*0.01) .and. (contains_mons(ig)) ) THEN 586 590 coefdetrain(ig,l)=1.*( rhobarz(ig,l+1)*abs(wfin(ig,l+1)) - rhobarz(ig,l)*abs(wfin(ig,l)) ) / masse(ig,l) 587 591 !! Detrainment when abs(w(l)) > abs(w(l+1)), i.e. coefdetrain < 0 … … 601 605 ! dqdet_topdust_number(ig,l)=-(1.-exp(coefdetrain(ig,l)*ptimestep))*zq_dust_number(ig,l)/ptimestep 602 606 endif 603 !! Full detrainment during the night imposed607 !! Full detrainment imposed during the night or when topdust leaves its origin column (contains_mons=False) 604 608 ELSE 605 609 dqdet_topdust_mass(ig,l)=-zq_topdust_mass(ig,l)/ptimestep … … 681 685 CALL WRITEDIAGFI(ngrid,'wfin_top', & 682 686 'wfin_top','',3,wfin(:,:)) 687 CALL WRITEDIAGFI(ngrid,'hmons', & 688 'hmons','',2,hmons) 689 CALL WRITEDIAGFI(ngrid,'hsummit', & 690 'hsummit','',2,hsummit) 683 691 CALL WRITEDIAGFI(ngrid,'alpha_hmons', & 684 692 'alpha_hmons','',2,alpha_hmons) … … 961 969 962 970 963 end subroutine van_leer 964 971 end subroutine van_leer 972 965 973 !******************************************************************************** 966 ! initialization module variables 967 subroutine ini_topmons_mod(ngrid,nlayer) 968 969 implicit none 970 971 integer, intent(in) :: ngrid 972 integer, intent(in) :: nlayer 973 974 allocate(alpha_hmons(ngrid)) 975 976 end subroutine ini_topmons_mod 977 978 subroutine end_topmons_mod 979 980 implicit none 981 982 if (allocated(alpha_hmons)) deallocate(alpha_hmons) 983 984 end subroutine end_topmons_mod 974 subroutine topmons_setup(ngrid) 975 ! Purpose: 976 ! 1) Fill the logical array contains_mons(:), 977 ! with contains_mons(ig)=True if there is 978 ! a mountain in the mesh ig 979 ! 2) Compute alpha_hmons(:) and hsummit(:) 980 use surfdat_h,only: phisfi,hmons,summit,base,& 981 alpha_hmons,hsummit,contains_mons 982 use comcstfi_h,only: pi,g 983 use planetwide_mod,only: planetwide_maxval, planetwide_minval 984 use geometry_mod,only: longitude_deg,latitude_deg,& 985 boundslon,boundslat !boundslon/lat(ngrid,4) : 986 ! |------------------------------| 987 ! |north_west=2 north_east=1| 988 ! | | 989 ! | (ig) | 990 ! | | 991 ! |south_west=3 south_east=4| 992 ! |------------------------------| 993 994 implicit none 995 integer,intent(in) :: ngrid 996 997 ! Local variables 998 integer,parameter :: ntop_max = 19 ! total number of mounts written in the hmons list 999 real lon_top(ntop_max),lat_top(ntop_max) ! coordinates of the mounts (in deg) 1000 ! Mountains list : 1001 ! Olympus Mons,Ascraeus Mons,Elysium Mons,Arsia Mons,Pavonis Mons, 1002 ! Hecates Tholus,Tharsis Tholus,Ceraunius Tholus,Alba Mons,Apollinaris Mons, 1003 ! Albor Tholus,Biblis Tholus,Anseris Mons,Ulysses Tholus,Aeolis Mons, 1004 ! Euripus Mons,Hadriacus Mons,Tyrrhenus Mons,Uranius Mons 1005 ! 1006 ! NB: in 64x48 horiz. resolution, Biblis Tholus & Ulysses Tholus fall in the 1007 ! same mesh, hence only Biblis Tholus is kept by the alpha_hmons computation 1008 data lon_top/-134.,-104.5,146.9,-121.1,-113.4,& 1009 150.2,-90.8,-97.4,-109.6,174.4,& 1010 150.4,-124.6,86.6,-121.6,137.8,& 1011 105.,91.8,106.5,-92.2/ 1012 data lat_top/18.4,11.8,24.8,-8.4,-0.8,& 1013 31.8,13.4,24.,40.4,-9.3,& 1014 18.8,2.6,-29.8,2.9,-5.4,& 1015 -44.8,-32.1,-21.1,26.8/ 1016 integer,parameter :: ntop = 19 ! the topmons scheme is limited to the first ntop mounts 1017 real :: boundslon_deg(4),boundslat_deg(4) 1018 real :: hmax,hmin 1019 integer :: ig,itop 1020 1021 1022 1023 IF (ngrid.gt.1) THEN 1024 ! Sanity check 1025 if (ntop.gt.ntop_max) then 1026 call abort_physic("topmons_setup","Number of mountains ntop greater than ntop_max",1) 1027 endif 1028 1029 ! Determine contains_mons 1030 contains_mons(:)=.false. 1031 1032 do ig=1,ngrid 1033 boundslon_deg(:)=boundslon(ig,:)/pi*180. 1034 boundslat_deg(:)=boundslat(ig,:)/pi*180. 1035 1036 do itop=1,ntop 1037 if ( (lon_top(itop).gt.boundslon_deg(2)).and.(lon_top(itop).lt.boundslon_deg(1)) & 1038 .and.(lat_top(itop).gt.boundslat_deg(3)).and.(lat_top(itop).lt.boundslat_deg(2)) ) then 1039 contains_mons(ig)=.true. 1040 write(*,*) "topmons_setup: Found a mount at:" 1041 write(*,*) "(",boundslon_deg(2),",",boundslat_deg(2),") (",boundslon_deg(1),",",boundslat_deg(1),")" 1042 write(*,*) " ((",lon_top(itop),",",lat_top(itop),"))" 1043 write(*,*) "(",boundslon_deg(3),",",boundslat_deg(3),") (",boundslon_deg(4),",",boundslat_deg(4),")" 1044 endif 1045 enddo 1046 enddo 1047 1048 ! Compute alpha_hmons 1049 call planetwide_maxval(hmons,hmax) 1050 call planetwide_minval(hmons,hmin) 1051 do ig=1,ngrid 1052 if (contains_mons(ig)) then 1053 ! the mesh ig contains a mountain 1054 alpha_hmons(ig)= 0.5*(hmons(ig)-hmin)/(hmax-hmin) 1055 ! Sanity check 1056 if (alpha_hmons(ig).le.0) then 1057 call abort_physic("topmons_setup","ERROR: alpha_hmons cannot be <0 "//& 1058 "if the mesh contains a mountain. Please check your "//& 1059 "formula or your start files.",1) 1060 endif 1061 else 1062 ! the mesh ig doesn't contain a mountain 1063 alpha_hmons(ig)= 0 1064 endif 1065 enddo 1066 1067 ! Compute hsummit 1068 hsummit(:)=summit(:)-phisfi(:)/g 1069 1070 ELSE ! 1D case 1071 hmin=0. 1072 hmax=23162.1 !set here the height of the sub-grid scale topography 1073 do ig=1,ngrid 1074 alpha_hmons(ig)= (hmons(ig)-hmin)/(hmax-hmin) !0.1*(hmons(ig)-hmin)/(hmax-hmin) 1075 print*,"1D, hmons=",hmons(ig),"alpha=",alpha_hmons(ig) 1076 enddo 1077 1078 hsummit(:)=14000. 1079 ENDIF ! (ngrid.gt.1) 1080 1081 end subroutine topmons_setup 1082 !******************************************************************************** 985 1083 986 1084 END MODULE topmons_mod
Note: See TracChangeset
for help on using the changeset viewer.