Changeset 3672 for trunk/LMDZ.GENERIC
- Timestamp:
- Mar 6, 2025, 11:25:14 AM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/libf/phystd/dyn1d/rcm1d.F
r3663 r3672 36 36 use mod_interface_dyn_phys, only: init_interface_dyn_phys 37 37 use inifis_mod, only: inifis 38 use phys_state_var_mod, only: phys_state_var_init 38 use phys_state_var_mod, only: phys_state_var_init, tsurf, tsoil 39 39 use physiq_mod, only: physiq 40 40 use restart1D_mod, only: writerestart1D … … 48 48 49 49 !================================================================== 50 ! 50 ! 51 51 ! Purpose 52 52 ! ------- 53 53 ! Run the physics package of the universal model in a 1D column. 54 ! 54 ! 55 55 ! It can be compiled with a command like (e.g. for 25 layers): 56 56 ! "makegcm -p std -d 25 rcm1d" … … 95 95 REAL play(llm) ! Pressure at the middle of the layers (Pa) 96 96 REAL plev(llm+1) ! intermediate pressure levels (pa) 97 REAL psurf ,tsurf(1)97 REAL psurf 98 98 REAL u(llm),v(llm) ! zonal, meridional wind 99 99 REAL gru,grv ! prescribed "geostrophic" background wind … … 101 101 REAL,ALLOCATABLE :: q(:,:) ! tracer mixing ratio (e.g. kg/kg) 102 102 REAL,ALLOCATABLE :: qsurf(:) ! tracer surface budget (e.g. kg.m-2) 103 REAL,ALLOCATABLE :: tsoil(:) ! subsurface soil temperature (K)104 103 ! REAL co2ice ! co2ice layer (kg.m-2) !not used anymore 105 104 integer :: i_co2_ice=0 ! tracer index of co2 ice … … 114 113 REAL du(llm),dv(llm),dtemp(llm) 115 114 REAL dudyn(llm),dvdyn(llm),dtempdyn(llm) 116 REAL dpsurf(1) 115 REAL dpsurf(1) 117 116 REAL,ALLOCATABLE :: dq(:,:) 118 117 REAL,ALLOCATABLE :: dqdyn(:,:) … … 126 125 REAL tmp1(0:llm),tmp2(0:llm) 127 126 integer :: nq !=1 ! number of tracers 128 127 129 128 character*2 str2 130 129 character (len=7) :: str7 … … 181 180 endif 182 181 183 ! check if 'rcm1d.def' file is around 182 ! check if 'rcm1d.def' file is around 184 183 open(90,file='rcm1d.def',status='old',form='formatted', 185 184 & iostat=ierr) … … 257 256 endif 258 257 close(90) 259 258 260 259 ! Initialize dimphy module 261 call init_dimphy(1,llm) 262 260 call init_dimphy(1,llm) 261 263 262 ! now initialize arrays using phys_state_var_init 264 263 ! but first initialise naerkind (from callphys.def) 265 264 naerkind=0 !default 266 265 call getin("naerkind",naerkind) 267 266 268 267 call phys_state_var_init(nq) 269 268 270 269 saveprofile=.false. 271 270 saveprofile=.true. … … 277 276 pi=2.E+0*asin(1.E+0) 278 277 279 c Parametres Couche limite et Turbulence 278 c Parametres Couche limite et Turbulence 280 279 c -------------------------------------- 281 z0 = 1.e-2 ! surface roughness (m) ~0.01 282 280 z0 = 1.e-2 ! surface roughness (m) ~0.01 281 283 282 c propriete optiques des calottes et emissivite du sol 284 283 c ---------------------------------------------------- 285 284 emissiv= 0.95 ! Emissivite du sol martien ~.95 286 285 emisice(1)=0.95 ! Emissivite calotte nord 287 emisice(2)=0.95 ! Emissivite calotte sud 286 emisice(2)=0.95 ! Emissivite calotte sud 288 287 289 288 iceradius(1) = 100.e-6 ! mean scat radius of CO2 snow (north) … … 294 293 295 294 c ------------------------------------------------------ 296 c Load parameters from "run.def" and "gases.def" 295 c Load parameters from "run.def" and "gases.def" 297 296 c ------------------------------------------------------ 298 297 … … 355 354 stop 356 355 endif 357 356 358 357 do iq=1,nq 359 358 ! minimal version, just read in the tracer names, 1 per line … … 391 390 nq=0 392 391 ! still, make allocations for 1 dummy tracer 393 allocate(tname(1)) 392 allocate(tname(1)) 394 393 allocate(qsurf(1)) 395 394 allocate(q(llm,1)) 396 395 allocate(dq(llm,1)) 397 396 398 397 ! Check that tracer boolean is compliant with number of tracers 399 398 ! -- otherwise there is an error (and more generally we have to be consistent) … … 413 412 !!! GEOPOTENTIAL. useless in 1D because control by surface pressure 414 413 phisfi(1)=0.E+0 415 !!! LATITUDE. can be set. 414 !!! LATITUDE. can be set. 416 415 latitude=0 ! default value for latitude 417 416 PRINT *,'latitude (in degrees) ?' … … 468 467 PRINT *,"STOP. I NEED year_day IN RCM1D.DEF." 469 468 STOP 470 ELSE 469 ELSE 471 470 PRINT *,"--> year_day = ",year_day 472 471 ENDIF … … 501 500 PRINT *,"STOP. peri_day.gt.year_day" 502 501 STOP 503 ELSE 502 ELSE 504 503 PRINT *,"--> peri_day = ", peri_day 505 ENDIF 506 507 obliquit = -99999. 504 ENDIF 505 506 obliquit = -99999. 508 507 PRINT *,'OBLIQUITY in deg ?' 509 508 call getin("obliquit",obliquit) … … 513 512 ELSE 514 513 PRINT *,"--> obliquit = ",obliquit 515 ENDIF 514 ENDIF 516 515 517 516 if (restart) then … … 552 551 c Date (en sols depuis le solstice de printemps) du debut du run 553 552 !if (restart) then 554 ! ! day 553 ! ! day 555 554 ! ierr=NF90_INQ_VARID(nid_restart1D,'day',did) 556 555 ! if (ierr==NF90_NOERR) then … … 609 608 nday=ndt 610 609 611 ndt=ndt*day_step 612 dtphys=daysec/day_step 610 ndt=ndt*day_step 611 dtphys=daysec/day_step 613 612 write(*,*)"-------------------------------------" 614 613 write(*,*)"-------------------------------------" … … 635 634 !!! - read callphys.def 636 635 !!! - calculate sine and cosine of longitude and latitude 637 !!! - calculate mugaz and cp 636 !!! - calculate mugaz and cp 638 637 !!! NB: some operations are being done dummily in inifis in 1D 639 638 !!! - physical constants: nevermind, things are done allright below … … 645 644 646 645 nsoil=nsoilmx 647 allocate(tsoil(nsoilmx))648 !! those are defined in comsoil_h.F90649 IF (.not.ALLOCATED(layer)) ALLOCATE(layer(nsoilmx))650 IF (.not.ALLOCATED(mlayer)) ALLOCATE(mlayer(0:nsoilmx-1))651 IF (.not.ALLOCATED(inertiedat)) ALLOCATE(inertiedat(1,nsoilmx))652 646 653 647 ! At this point, both getin() and getin_p() functions have been used, … … 698 692 ENDDO 699 693 ENDDO 700 694 701 695 DO iq=1,nq 702 696 qsurf(iq) = 0. 703 697 ENDDO 704 705 if (tracer) then ! Initialize tracers here. 706 698 699 if (tracer) then ! Initialize tracers here. 700 707 701 write(*,*) "rcm1d : initializing tracers profiles" 708 702 … … 738 732 endif 739 733 else ! restart 740 734 741 735 txt="" 742 736 write(txt,"(a)") tname(iq) 743 737 write(*,*)" tracer:",trim(txt) 744 738 745 739 ! CO2 746 740 if (txt.eq."co2_ice") then 747 741 q(:,iq)=0. ! kg/kg of atmosphere 748 qsurf(iq)=0. ! kg/m2 at the surface 742 qsurf(iq)=0. ! kg/m2 at the surface 749 743 ! Look for a "profile_co2_ice" input file 750 744 open(91,file='profile_co2_ice',status='old', … … 760 754 close(91) 761 755 endif ! of if (txt.eq."co2") 762 756 763 757 ! WATER VAPOUR 764 758 if (txt.eq."h2o_vap") then 765 759 q(:,iq)=0. ! kg/kg of atmosphere 766 760 qsurf(iq)=0. ! kg/m2 at the surface 767 ! Look for a "profile_h2o_vap" input file 761 ! Look for a "profile_h2o_vap" input file 768 762 open(91,file='profile_h2o_vap',status='old', 769 763 & form='formatted',iostat=ierr) … … 778 772 close(91) 779 773 endif ! of if (txt.eq."h2o_vap") 780 774 781 775 ! WATER ICE 782 776 if (txt.eq."h2o_ice") then … … 807 801 open(91,file=tracer_profile_file_name,status='old', 808 802 & form="formatted",iostat=ierr) 809 if (ierr .eq. 0) then 803 if (ierr .eq. 0) then 810 804 read(91,*)qsurf(iq) 811 do ilayer=1,nlayer 805 do ilayer=1,nlayer 812 806 read(91,*)q(ilayer,iq) 813 enddo 814 else 807 enddo 808 else 815 809 write(*,*) "No initial profile " 816 810 write(*,*) " for this tracer :" … … 818 812 endif 819 813 close(91) 820 endif ! (txt .eq. "_vap") 821 !_ice 822 if((txt.ne."h2o_ice") .and. 814 endif ! (txt .eq. "_vap") 815 !_ice 816 if((txt.ne."h2o_ice") .and. 823 817 & (index(txt,'_ice' ) /= 0)) then 824 818 q(:,iq)=0. !kg/kg of atmosphere … … 827 821 endif ! restart 828 822 enddo ! of do iq=1,nq 829 823 830 824 endif ! of tracer 831 825 … … 833 827 c ------------------------------------------------------ 834 828 ptif=2.E+0*omeg*sinlat(1) 835 829 836 830 837 831 c vent geostrophique … … 941 935 942 936 if(autozlevs)then 943 937 944 938 open(91,file="z2sig.def",form='formatted') 945 939 read(91,*) Hscale … … 948 942 enddo 949 943 close(91) 950 951 944 945 952 946 print*,'Hmax = ',Hmax,' km' 953 947 print*,'Auto-shifting Hscale to:' … … 955 949 Hscale = Hmax / log(psurf/pceil) 956 950 print*,'Hscale = ',Hscale,' km' 957 951 958 952 ! none of this matters if we dont care about zlay 959 953 960 954 endif 961 955 … … 981 975 plev(ilevel)=ap(ilevel)+psurf*bp(ilevel) 982 976 ENDDO 983 977 984 978 DO ilayer=1,nlayer 985 979 play(ilayer)=aps(ilayer)+psurf*bps(ilayer) 986 980 ENDDO 987 981 988 982 989 983 … … 1061 1055 DO isoil=1,nsoil 1062 1056 inertiedat(1,isoil)=inertiedat(1,1) ! soil thermal inertia 1063 tsoil( isoil)=tsurf(1) ! soil temperature1057 tsoil(1,isoil)=tsurf(1) ! soil temperature 1064 1058 ENDDO 1065 1059 … … 1139 1133 & dtphys,time, 1140 1134 & tsurf,tsoil,emis,albedo,q2,qsurf, 1141 & cloudfrac,totcloudfrac,hice, 1135 & cloudfrac,totcloudfrac,hice, 1142 1136 & rnat,pctsrf_sic,tslab,tsea_ice,tice,sea_ice) 1143 1137 endif 1144 1138 c======================================================================= 1145 c BOUCLE TEMPORELLE DU MODELE 1D 1139 c BOUCLE TEMPORELLE DU MODELE 1D 1146 1140 c======================================================================= 1147 1141 … … 1162 1156 ENDIF 1163 1157 1164 c calcul du geopotentiel 1158 c calcul du geopotentiel 1165 1159 c ~~~~~~~~~~~~~~~~~~~~~ 1166 1160 … … 1197 1191 , day,time,dtphys, 1198 1192 , plev,play,phi, 1199 , u, v,temp, q, 1193 , u, v,temp, q, 1200 1194 , w, 1201 1195 C - sorties … … 1205 1199 c evolution du vent : modele 1D 1206 1200 c ----------------------------- 1207 1201 1208 1202 c la physique calcule les derivees temporelles de u et v. 1209 1203 c on y rajoute betement un effet Coriolis. … … 1221 1215 ENDDO 1222 1216 c end if 1223 c 1217 c 1224 1218 c 1225 1219 c Calcul du temps au pas de temps suivant … … 1281 1275 if (lastcall) then 1282 1276 call writerestart1D('restart1D.nc',nlayer,nsoil,day,time,psurf, 1283 & temp,tsoil,u,v,nq,q) 1277 & temp,tsoil,u,v,nq,q) 1284 1278 endif 1285 1279 … … 1290 1284 c ======================================================== 1291 1285 end !rcm1d 1292 1293 1286 1287
Note: See TracChangeset
for help on using the changeset viewer.