From 4281188278721a4b96814282f6c517d2c0750223 Mon Sep 17 00:00:00 2001 From: Marloes Date: Mon, 9 Dec 2024 14:20:42 +0100 Subject: [PATCH 1/2] Fit exit in modsampling and modsamptend --- cases/botany/baseprof.inp.001 | 350 +++++++++++++++---------------- cases/botany/namoptions-1536.001 | 53 ++--- cases/botany/scalar.inp.001 | 2 +- src/modsampling.f90 | 7 +- src/modsamptend.f90 | 3 +- 5 files changed, 212 insertions(+), 203 deletions(-) diff --git a/cases/botany/baseprof.inp.001 b/cases/botany/baseprof.inp.001 index 8f638b13e..6e86be126 100644 --- a/cases/botany/baseprof.inp.001 +++ b/cases/botany/baseprof.inp.001 @@ -1,177 +1,177 @@ #baseprofiles #height rhobf - 7.5 0.11796420812606812E+01 - 22.5 0.11780095100402832E+01 - 37.6 0.11763623952865601E+01 - 53.0 0.11747006177902222E+01 - 68.4 0.11730239391326904E+01 - 84.0 0.11713324785232544E+01 - 99.8 0.11696258783340454E+01 - 115.7 0.11679042577743530E+01 - 131.8 0.11661673784255981E+01 - 148.0 0.11644150018692017E+01 - 164.4 0.11626473665237427E+01 - 181.0 0.11608638763427734E+01 - 197.7 0.11590647697448730E+01 - 214.6 0.11572499275207520E+01 - 231.7 0.11554192304611206E+01 - 249.0 0.11535723209381104E+01 - 266.4 0.11517091989517212E+01 - 284.0 0.11498298645019531E+01 - 301.7 0.11479340791702271E+01 - 319.7 0.11460218429565430E+01 - 337.8 0.11440929174423218E+01 - 356.1 0.11421471834182739E+01 - 374.6 0.11401845216751099E+01 - 393.2 0.11382049322128296E+01 - 412.1 0.11362082958221436E+01 - 431.1 0.11341942548751831E+01 - 450.4 0.11321629285812378E+01 - 469.8 0.11301141977310181E+01 - 489.4 0.11280477046966553E+01 - 509.3 0.11259634494781494E+01 - 529.3 0.11238615512847900E+01 - 549.5 0.11217415332794189E+01 - 569.9 0.11196035146713257E+01 - 590.5 0.11174471378326416E+01 - 611.4 0.11152726411819458E+01 - 632.4 0.11130794286727905E+01 - 653.7 0.11108678579330444E+01 - 675.1 0.11086374521255493E+01 - 696.8 0.11063882112503052E+01 - 718.7 0.11041201353073120E+01 - 740.8 0.11018328666687012E+01 - 763.1 0.10995265245437622E+01 - 785.7 0.10972007513046265E+01 - 808.5 0.10948556661605835E+01 - 831.5 0.10924910306930542E+01 - 854.7 0.10901066064834595E+01 - 878.2 0.10877025127410889E+01 - 901.9 0.10852783918380737E+01 - 925.8 0.10828342437744141E+01 - 950.0 0.10803698301315308E+01 - 974.4 0.10778852701187134E+01 - 999.1 0.10753803253173828E+01 - 1024.0 0.10728551149368286E+01 - 1049.2 0.10703085660934448E+01 - 1074.6 0.10677412748336792E+01 - 1100.3 0.10651535987854004E+01 - 1126.2 0.10625455379486084E+01 - 1152.4 0.10599153041839600E+01 - 1178.8 0.10572640895843506E+01 - 1205.6 0.10545918941497803E+01 - 1232.5 0.10518969297409058E+01 - 1259.8 0.10491813421249390E+01 - 1287.3 0.10464442968368530E+01 - 1315.1 0.10436849594116211E+01 - 1343.2 0.10409045219421387E+01 - 1371.5 0.10381010770797729E+01 - 1400.2 0.10352758169174194E+01 - 1429.1 0.10324279069900513E+01 - 1458.3 0.10295585393905640E+01 - 1487.8 0.10266659259796143E+01 - 1517.7 0.10237503051757812E+01 - 1547.8 0.10208126306533813E+01 - 1578.2 0.10178521871566772E+01 - 1608.9 0.10148683786392212E+01 - 1639.9 0.10118621587753296E+01 - 1671.2 0.10088326930999756E+01 - 1702.8 0.10057795047760010E+01 - 1734.8 0.10027034282684326E+01 - 1767.1 0.99960297346115112E+00 - 1799.7 0.99648016691207886E+00 - 1832.6 0.99333333969116211E+00 - 1865.8 0.99016273021697998E+00 - 1899.4 0.98696750402450562E+00 - 1933.3 0.98374891281127930E+00 - 1967.6 0.98050719499588013E+00 - 2002.2 0.97724062204360962E+00 - 2037.1 0.97394949197769165E+00 - 2072.4 0.97063398361206055E+00 - 2108.1 0.96729439496994019E+00 - 2144.1 0.96393096446990967E+00 - 2180.4 0.96054202318191528E+00 - 2217.2 0.95712882280349731E+00 - 2254.3 0.95369064807891846E+00 - 2291.7 0.95022875070571899E+00 - 2329.6 0.94674050807952881E+00 - 2367.8 0.94322818517684937E+00 - 2406.4 0.93969106674194336E+00 - 2445.4 0.93612849712371826E+00 - 2484.8 0.93254077434539795E+00 - 2524.6 0.92892825603485107E+00 - 2564.7 0.92529022693634033E+00 - 2605.3 0.92162710428237915E+00 - 2646.3 0.91793823242187500E+00 - 2687.7 0.91422390937805176E+00 - 2729.5 0.91048443317413330E+00 - 2771.7 0.90671932697296143E+00 - 2814.3 0.90292888879776001E+00 - 2857.4 0.89911252260208130E+00 - 2900.9 0.89527058601379395E+00 - 2944.8 0.89140343666076660E+00 - 2989.2 0.88750964403152466E+00 - 3034.0 0.88359135389328003E+00 - 3079.3 0.87964630126953125E+00 - 3125.0 0.87567573785781860E+00 - 3171.2 0.87168002128601074E+00 - 3217.8 0.86765784025192261E+00 - 3264.9 0.86361038684844971E+00 - 3312.5 0.85953718423843384E+00 - 3360.5 0.85543787479400635E+00 - 3409.1 0.85131275653839111E+00 - 3458.1 0.84716153144836426E+00 - 3507.6 0.84298449754714966E+00 - 3557.6 0.83878213167190552E+00 - 3608.1 0.83455407619476318E+00 - 3659.1 0.83030068874359131E+00 - 3710.6 0.82602083683013916E+00 - 3762.6 0.82171571254730225E+00 - 3815.2 0.81738501787185669E+00 - 3868.3 0.81302845478057861E+00 - 3921.9 0.80864638090133667E+00 - 3976.0 0.80423939228057861E+00 - 4030.7 0.79980629682540894E+00 - 4085.9 0.79534846544265747E+00 - 4141.7 0.79086548089981079E+00 - 4198.1 0.78635722398757935E+00 - 4255.0 0.78182327747344971E+00 - 4312.4 0.77726507186889648E+00 - 4370.5 0.77268159389495850E+00 - 4429.1 0.76807326078414917E+00 - 4488.3 0.76343995332717896E+00 - 4548.1 0.75878220796585083E+00 - 4608.6 0.75409990549087524E+00 - 4669.6 0.74939346313476562E+00 - 4731.2 0.74466288089752197E+00 - 4793.4 0.73990869522094727E+00 - 4856.3 0.73512995243072510E+00 - 4919.8 0.73032736778259277E+00 - 4983.9 0.72550153732299805E+00 - 5048.7 0.72065156698226929E+00 - 5114.1 0.71577888727188110E+00 - 5180.1 0.71088337898254395E+00 - 5246.9 0.70596432685852051E+00 - 5314.2 0.70102304220199585E+00 - 5382.3 0.69605886936187744E+00 - 5451.1 0.69107240438461304E+00 - 5520.5 0.68606370687484741E+00 - 5590.6 0.68103349208831787E+00 - 5661.5 0.67598176002502441E+00 - 5733.0 0.67090851068496704E+00 - 5805.3 0.66581457853317261E+00 - 5878.2 0.66069924831390381E+00 - 5951.9 0.65556329488754272E+00 - 6026.4 0.65040755271911621E+00 - 6101.6 0.64523142576217651E+00 - 6177.5 0.64003574848175049E+00 - 6254.2 0.63482058048248291E+00 - 6331.7 0.62958616018295288E+00 - 6409.9 0.62433332204818726E+00 - 6488.9 0.61906218528747559E+00 - 6568.8 0.61377233266830444E+00 - 6649.4 0.60846525430679321E+00 - 6730.8 0.60314059257507324E+00 - 6813.0 0.59779924154281616E+00 - 6896.1 0.59244078397750854E+00 - 6980.0 0.58706611394882202E+00 + 7.5 0.11796421284722400E+01 + 22.5 0.11780095621339872E+01 + 37.6 0.11763624254738136E+01 + 53.0 0.11747006067426951E+01 + 68.4 0.11730239953433430E+01 + 84.0 0.11713324710136521E+01 + 99.8 0.11696259363576074E+01 + 115.7 0.11679042627062668E+01 + 131.8 0.11661673442867868E+01 + 148.0 0.11644150442060262E+01 + 164.4 0.11626473131153574E+01 + 181.0 0.11608638875367283E+01 + 197.7 0.11590648283424936E+01 + 214.6 0.11572499823052327E+01 + 231.7 0.11554191977550043E+01 + 249.0 0.11535723246002147E+01 + 266.4 0.11517092143486203E+01 + 284.0 0.11498298269118798E+01 + 301.7 0.11479341233045133E+01 + 319.7 0.11460218526276205E+01 + 337.8 0.11440928725765156E+01 + 356.1 0.11421471487824635E+01 + 374.6 0.11401845419411956E+01 + 393.2 0.11382049144832802E+01 + 412.1 0.11362082364102031E+01 + 431.1 0.11341942675868357E+01 + 450.4 0.11321629813020158E+01 + 469.8 0.11301141413238260E+01 + 489.4 0.11280477243119704E+01 + 509.3 0.11259634980320778E+01 + 529.3 0.11238615475322495E+01 + 549.5 0.11217415394347172E+01 + 569.9 0.11196034573904650E+01 + 590.5 0.11174471819173271E+01 + 611.4 0.11152725955061271E+01 + 632.4 0.11130794784814766E+01 + 653.7 0.11108678218277430E+01 + 675.1 0.11086374102526007E+01 + 696.8 0.11063882385388479E+01 + 718.7 0.11041200958753419E+01 + 740.8 0.11018328775745263E+01 + 763.1 0.10995264810920580E+01 + 785.7 0.10972008060501788E+01 + 808.5 0.10948556514064476E+01 + 831.5 0.10924910243812187E+01 + 854.7 0.10901066262152095E+01 + 878.2 0.10877024688140633E+01 + 901.9 0.10852783613562014E+01 + 925.8 0.10828342180304280E+01 + 950.0 0.10803698535631328E+01 + 974.4 0.10778852890357697E+01 + 999.1 0.10753803443091399E+01 + 1024.0 0.10728551462022538E+01 + 1049.2 0.10703085084037522E+01 + 1074.6 0.10677412732244043E+01 + 1100.3 0.10651535738345956E+01 + 1126.2 0.10625455444191385E+01 + 1152.4 0.10599153134950203E+01 + 1178.8 0.10572640301866005E+01 + 1205.6 0.10545918375742716E+01 + 1232.5 0.10518968847655388E+01 + 1259.8 0.10491813199107807E+01 + 1287.3 0.10464442958191891E+01 + 1315.1 0.10436849743626653E+01 + 1343.2 0.10409045057096771E+01 + 1371.5 0.10381010706027931E+01 + 1400.2 0.10352758236722692E+01 + 1429.1 0.10324279458249457E+01 + 1458.3 0.10295585900739082E+01 + 1487.8 0.10266659647840422E+01 + 1517.7 0.10237502505785878E+01 + 1547.8 0.10208126043348527E+01 + 1578.2 0.10178522301743032E+01 + 1608.9 0.10148683421762685E+01 + 1639.9 0.10118621012307611E+01 + 1671.2 0.10088327285233856E+01 + 1702.8 0.10057794554829895E+01 + 1734.8 0.10027034472103593E+01 + 1767.1 0.99960298312859053E+00 + 1799.7 0.99648019060627346E+00 + 1832.6 0.99333336108776871E+00 + 1865.8 0.99016271082252927E+00 + 1899.4 0.98696750752949636E+00 + 1933.3 0.98374892530395397E+00 + 1967.6 0.98050718498859124E+00 + 2002.2 0.97724062312344440E+00 + 2037.1 0.97394947805796683E+00 + 2072.4 0.97063398981008020E+00 + 2108.1 0.96729440004484180E+00 + 2144.1 0.96393095205291746E+00 + 2180.4 0.96054202965657509E+00 + 2217.2 0.95712882251894082E+00 + 2254.3 0.95369066099057864E+00 + 2291.7 0.95022873312445244E+00 + 2329.6 0.94674053720053553E+00 + 2367.8 0.94322819283428350E+00 + 2406.4 0.93969105539300701E+00 + 2445.4 0.93612849253572772E+00 + 2484.8 0.93254079410300106E+00 + 2524.6 0.92892825180039718E+00 + 2564.7 0.92529025487786554E+00 + 2605.3 0.92162710690273242E+00 + 2646.3 0.91793821455565305E+00 + 2687.7 0.91422389352643418E+00 + 2729.5 0.91048446147082518E+00 + 2771.7 0.90671934760545381E+00 + 2814.3 0.90292888196318566E+00 + 2857.4 0.89911251191892338E+00 + 2900.9 0.89527058013403160E+00 + 2944.8 0.89140343131983912E+00 + 2989.2 0.88750966039440460E+00 + 3034.0 0.88359137969757418E+00 + 3079.3 0.87964633011171278E+00 + 3125.0 0.87567575828405053E+00 + 3171.2 0.87168003707268904E+00 + 3217.8 0.86765781966135946E+00 + 3264.9 0.86361035924188145E+00 + 3312.5 0.85953718946671231E+00 + 3360.5 0.85543785853300203E+00 + 3409.1 0.85131277779881875E+00 + 3458.1 0.84716151559270703E+00 + 3507.6 0.84298449726806968E+00 + 3557.6 0.83878215044937920E+00 + 3608.1 0.83455406935115140E+00 + 3659.1 0.83030069575488841E+00 + 3710.6 0.82602081552159934E+00 + 3762.6 0.82171572047523722E+00 + 3815.2 0.81738504663368050E+00 + 3868.3 0.81302844563463794E+00 + 3921.9 0.80864640061297044E+00 + 3976.0 0.80423939705306524E+00 + 4030.7 0.79980630497510596E+00 + 4085.9 0.79534844048556641E+00 + 4141.7 0.79086550432346880E+00 + 4198.1 0.78635721343460496E+00 + 4255.0 0.78182330113644660E+00 + 4312.4 0.77726510002390481E+00 + 4370.5 0.77268156741081273E+00 + 4429.1 0.76807325996725129E+00 + 4488.3 0.76343995616728966E+00 + 4548.1 0.75878222829704256E+00 + 4608.6 0.75409987773254206E+00 + 4669.6 0.74939349245517328E+00 + 4731.2 0.74466289691102139E+00 + 4793.4 0.73990869483787491E+00 + 4856.3 0.73512997556793547E+00 + 4919.8 0.73032737001648129E+00 + 4983.9 0.72550151144500186E+00 + 5048.7 0.72065154159546552E+00 + 5114.1 0.71577886430835225E+00 + 5180.1 0.71088339192527328E+00 + 5246.9 0.70596431929217729E+00 + 5314.2 0.70102306864028929E+00 + 5382.3 0.69605886668844519E+00 + 5451.1 0.69107242065743280E+00 + 5520.5 0.68606372060681486E+00 + 5590.6 0.68103349000438995E+00 + 5661.5 0.67598174313570081E+00 + 5733.0 0.67090851250527106E+00 + 5805.3 0.66581455192825290E+00 + 5878.2 0.66069921937807186E+00 + 5951.9 0.65556329722052586E+00 + 6026.4 0.65040756967535185E+00 + 6101.6 0.64523145005223470E+00 + 6177.5 0.64003575119303746E+00 + 6254.2 0.63482060977887189E+00 + 6331.7 0.62958618109323383E+00 + 6409.9 0.62433330831322742E+00 + 6488.9 0.61906217112499184E+00 + 6568.8 0.61377230729509280E+00 + 6649.4 0.60846525929179229E+00 + 6730.8 0.60314059792333019E+00 + 6813.0 0.59779922500526239E+00 + 6896.1 0.59244075752926939E+00 + 6980.0 0.58706612590478491E+00 diff --git a/cases/botany/namoptions-1536.001 b/cases/botany/namoptions-1536.001 index b1fb59570..d36c5360d 100644 --- a/cases/botany/namoptions-1536.001 +++ b/cases/botany/namoptions-1536.001 @@ -2,8 +2,8 @@ iexpnr = 001 lwarmstart = .false. startfile = 'initdlatestmx000y000.001' -runtime = 43200 -trestart = 43200 +runtime = 400 +trestart = -1 ladaptive = .true. irandom = 44 randthl = 0.1 @@ -12,17 +12,17 @@ nsv = 2 courant = .5 peclet = .1 loutdirs = .true. -nprocx = 32 -nprocy = 32 +nprocx = 2 +nprocy = 2 / &DOMAIN -itot = 1536 -jtot = 1536 +itot = 80 +jtot = 80 kmax = 175 -xsize = 153600 -ysize = 153600 +xsize = 8000 +ysize = 8000 xlat = 13.1 xlon = 302 @@ -67,7 +67,7 @@ iadv_mom = 62 iadv_tke = 62 iadv_thl = 62 iadv_qt = 52 -iadv_sv = 52, 52 +iadv_sv = 52 / &NAMMICROPHYSICS @@ -85,10 +85,15 @@ dtav = 60 tcheck = 0 / &NAMSAMPLING -lsampcl = .false. +lsampcl = .true. lsampco = .false. dtav = 60 -timeav = 21600 +timeav = 60 +lsamptend = .true. +lsamptendw = .true. +lsamptendthl = .true. +lsamptendqt = .true. +lprocblock = .true. / &NAMTIMESTAT ltimestat = .true. @@ -112,20 +117,20 @@ lcape = .true. dtav = 300 / &NAMFIELDDUMP -lfielddump = .true. +lfielddump = .false. ! lclassic = .false. -dtav = 3600 -khigh = 149 ! 132=4030m 149=5048m +! dtav = 3600 +! khigh = 149 ! 132=4030m 149=5048m ! tmin = 43200 ! start fielddumps at 12h (implemented in to4.4_Fredrik) ! select vartiables to store (implemented in to4.4_Fredrik, not in v4.3) -lu = .true. ! consider omitting u, v -lv = .true. -lw = .true. -lqt = .true. -lql = .true. -lthl = .true. -lbuoy = .false. -lsv = .false., .true. ! not Nr, just qr +! lu = .true. ! consider omitting u, v +! lv = .true. +! lw = .true. +! lqt = .true. +! lql = .true. +! lthl = .true. +! lbuoy = .false. +! lsv = .false., .true. ! not Nr, just qr / &NAMSTATTEND dtav = 60 @@ -170,7 +175,7 @@ tnudgefac = 1. &VVUQ_extra dudz = 0.0022 u0 = -10 -thl_low = +! thl_low = w0 = 0.0045 wpamp = -0.00085 case = 2 @@ -183,4 +188,4 @@ qt_tend0 = -1.73e-08 dthl0 = 1.25 !thl_tend_z_max = 2000 !qt_tend_z_max = 4000 -/ \ No newline at end of file +/ diff --git a/cases/botany/scalar.inp.001 b/cases/botany/scalar.inp.001 index 23f3b1fc6..3cc80a293 100644 --- a/cases/botany/scalar.inp.001 +++ b/cases/botany/scalar.inp.001 @@ -1,5 +1,5 @@ # -# height sv1 sv2 ... +#height sv1 sv2 7.5 0 0 22.5 0 0 37.65 0 0 diff --git a/src/modsampling.f90 b/src/modsampling.f90 index 5c61ba12c..04f0959d7 100644 --- a/src/modsampling.f90 +++ b/src/modsampling.f90 @@ -299,7 +299,7 @@ subroutine initsampling end subroutine initsampling !> Cleans up after the run subroutine exitsampling - use modstat_nc, only : lnetcdf + use modstat_nc, only : exitstat_nc,lnetcdf use modmpi, only : myid implicit none @@ -311,7 +311,10 @@ subroutine exitsampling pfavl ,dwdthavl,dwwdzhavl,dpdzhavl,duwdxhavl,dtaudxhavl,dtaudzhavl, & thvhavl ,fcorhavl,wh_el,sigh_el) deallocate(wadvhavl,subphavl,nrtsamphav) - if (lnetcdf .and. myid==0) deallocate(ncname) + if (lnetcdf .and. myid==0) then + call exitstat_nc(ncid) + deallocate(ncname) + end if end subroutine exitsampling diff --git a/src/modsamptend.f90 b/src/modsamptend.f90 index b56001974..52bfd7e14 100644 --- a/src/modsamptend.f90 +++ b/src/modsamptend.f90 @@ -1601,12 +1601,13 @@ end subroutine writenetcdf_proc !> Cleans up after the run subroutine exitsamptend - use modstat_nc, only: lnetcdf + use modstat_nc, only: exitstat_nc,lnetcdf implicit none if (.not. lsamptend) return if(isamptot == 0) return if(.not.(lnetcdf)) return + call exitstat_nc(ncid) if (lsamptendu) deallocate (uptm, upmn, upav, ust) if (lsamptendv) deallocate (vptm, vpmn, vpav, vst) if (lsamptendw) deallocate (wptm, wpmn, wpav, wst) From c8179c5f997f5093cfb6fd86f2b6d41a3be1741f Mon Sep 17 00:00:00 2001 From: Marloes Date: Tue, 10 Dec 2024 09:37:59 +0100 Subject: [PATCH 2/2] Add exitstat_nc in exitsampling and exitsamptend --- src/modsampling.f90 | 6 +++--- src/modsamptend.f90 | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modsampling.f90 b/src/modsampling.f90 index 04f0959d7..7c1d2eb5d 100644 --- a/src/modsampling.f90 +++ b/src/modsampling.f90 @@ -312,9 +312,9 @@ subroutine exitsampling thvhavl ,fcorhavl,wh_el,sigh_el) deallocate(wadvhavl,subphavl,nrtsamphav) if (lnetcdf .and. myid==0) then - call exitstat_nc(ncid) - deallocate(ncname) - end if + call exitstat_nc(ncid) + deallocate(ncname) + end if end subroutine exitsampling diff --git a/src/modsamptend.f90 b/src/modsamptend.f90 index 52bfd7e14..b7f24d069 100644 --- a/src/modsamptend.f90 +++ b/src/modsamptend.f90 @@ -1607,7 +1607,7 @@ subroutine exitsamptend if (.not. lsamptend) return if(isamptot == 0) return if(.not.(lnetcdf)) return - call exitstat_nc(ncid) + call exitstat_nc(ncid) if (lsamptendu) deallocate (uptm, upmn, upav, ust) if (lsamptendv) deallocate (vptm, vpmn, vpav, vst) if (lsamptendw) deallocate (wptm, wpmn, wpav, wst)