Parent Directory | Revision Log
Sticky Revision: |
offline allows to save variables for another run with offline transport, but there is no provision for this other run with offline transport in LMDZE. The procedures read_pstoke and read_pstoke0 in LMDZ are never called. So removed the possibility offline = T.
clcdrag is no longer used in LMDZ. Replaced by cdrag in LMDZ. In cdrag in LMDZ, zxli is a symbolic constant, false. So removed case zxli true in LMDZE. read_sst is called zero (if no ocean point on the whole planet) time or once per call of physiq. If mod(itap - 1, lmt_pas) == 0 then we have advanced in time of lmt_pas and deja_lu is necessarily false. qsat[sl] and dqsat[sl] were never called. Added output of qsurf in histins, following LMDZ. Last dummy argument dtime of phystokenc is always the same as first dummy argument pdtphys, removed dtime. Removed make rules for nag_xref95, since it does not exist any longer.
Removed unused aerosol variables. In procedure sw, ptopswai and psolswai were always 0.
run_off_lic downgraded from variable of module interface_surf to local variable of fonte_neige. Code could not work with ok_aie set to true, so removed this possibility. tauae, piz_ae, cg_ae, topswai, solswai were then 0. cldtaupi was the same as cldtaupd. In sw and procedures called by sw, flag_aer did not need to be double precision, changed it to logical. Downgraded re and fl from arguments of newmicro to local variables. Added output of re and fl (following LMDZ).
size(snow) is now knon in interfsurf_hq. Renamed snow to fsnow in clmain, same name as corresponding actual argument. We can then rename ysnow to simply snow in clmain, same name as corresponding dummy argument of clqh. No need to initialize local snow to 0 since it is only used with indices 1:knon and already initialized from fsnow for each type of surface. If there is no point for a given type of surface, fsnow should be reset to 0 for this type. We need to give a valid value to fsnow in this case even if it will be multiplied by pctsrf = 0 in physiq. In physiq, no need for intermediate zxsnow for output. Removed unused arguments tsurf, p1lay, beta, coef1lay, ps, t1lay, q1lay, u1lay, v1lay, petAcoef, peqAcoef, petBcoef, peqBcoef of fonte_neige, with unused computations of zx_qs and zcor. (Same was done in LMDZ.)
Removed module conema3_m. Moved variables epmax and iflag_clw of conema3_m to conf_phys_m, where they are defined. Removed unused variable ok_adj_ema of conema3_m. Added variables d_t_ec, dtsw0 and dtlw0 to histins.nc (following LMDZ). Removed case not lessivage in phytrac. (Not used in LMDZ without INCA either.)
Moved variables from module com_io_dyn to module inithist_m, where they are defined. Split grid_atob.f into grille_m.f and dist_sphe.f. Extracted ASCCI art to documentation. In grille_m, use automatic arrays instead of maximum size. In grille_m, instead of printing data for every problematic point, print a single diagnostic message. Removed variables top_height, overlap, lev_histhf, lev_histday, lev_histmth, type_run, ok_isccp, ok_regdyn, lonmin_ins, lonmax_ins, latmin_ins, latmax_ins of module clesphys, not used. Removed variable itap of module histwrite_phy_m, not used. There is a variable itap in module time_phylmdz. Added output of tro3. In physiq, no need to compute wo at every time-step, since we only use it in radlwsw.
Removed option online = f in conf_guide (following LMDZ). Moved computation of alpha_[uvtq] from guide to conf_guide. The aim (for clarity) is to remove from guide things which should only be done once. Had then to move computation of dxdyu, dxdyv from init_tau2alpha to conf_guide to avoid circular dependency (use of guide_u, guide_v in init_tau2alpha).
Replaced explicit Euler integration of nudged fields by exact integration (following LMDZ revision 2134).
The program did not work with cycle_diurne set to false. mu0 in physiq, which is supposed to be a cosine, was set to -999.999. So prmu in swu had a value of the order of 1e3. So zrmum1 in sw2s had a value of the order of 1e3. So zrayl in sw2s had a value of the order of 1e15. So ztray and ptauaz in swclr also had a large value. So zcorae at line 138 in swclr had a large negative value, which resulted in overflow at line 138. This assignment of -999.999 to mu0 dates from somewhere between revisions 348 and 524 of LMDZ. It was corrected in revision 1068 of LMDZ with a call to angle which was present in revision 348. However, procedure angle was removed from LMDZE in revision 22 because it was not used. Hesitated to bring back angle but, finally, just removed the option of having no diurnal cycle.
Module academic was not used. Useful values for iflag_phys were only 0 and 1 so changed type to logical. Definition of fmagic was duplicated in procedures alboc and alboc_cd so moved it up to interfsurf_hq and also moved multiplication by fmagic (following LMDZ).
New philosophy on compiler options. Removed source code for thermcep = f. (Not used in LMDZ either.)
dnwd0 is just - mp. Compute it simply in concvl. da, phi and mp were set to 0 in physiq before the call to concvl. Clearer to set da1, phi1 and mp1 to 0 in cv_driver so they are intent out. qcheck was debugging, printed to standard output and was called several times per time step of physics. zxtsol was a duplicate of ztsol.
Removed calls to diagphy and diagetpq. Those were debugging procedures, which printed to standard output and were called several times per time step of physics.
Promoted lmt_pas from local variable of physiq to variable of module conf_gcm_m. Removed variable run_off of module interface_surf. Was not used. Called run_off_ter in LMDZ, but not used nor printed there either. Simplified logic in interfoce_lim. The way it was convoluted with interfsurf_hq and clmain was quite a mess. Extracted reading of SST into a separate procedure: read_sst. We do not need SST and pctsrf_new at the same time: SST is not needed for sea-ice surface. I did not like this programming: going through the procedure repeatedly for different purposes and testing inside whether there was something to do or it was already done. Reading is now only controlled by itap and lmt_pas, instead of debut, jour, jour_lu and deja_lu. Now we do not copy from pct_tmp to pctsrf_new every time step. Simplified processing of pctsrf in clmain and below. It was quite troubling: pctsrf_new was intent out in interfoce_lim but only defined for ocean and sea-ice. Also the idea of having arrays for all surfaces, pcsrf and pctsrf_new, in interfsurf_hq, which is called for a particular surface, was troubling. pctsrf_new for all surfaces was intent out in intefsurf_hq, but not defined for all surfaces at each call. Removed argument pctsrf_new of clmain: was a duplicate of pctsrf on output, and not used in physiq. Replaced pctsrf_new in clmain by pctsrf_new_oce and pctsrf_new_sic, which were the only ones modified.
Removed intermediary objects of cv_thermo_m, access suphec_m directly. Procedure cv_thermo disappeared, all objects are named constants. In cv_driver and below, limited extents of arrays to what is needed. lv, cpn and th in cv30_compress were set at level nl + 1 but lv1, cpn1 and th1 are not defined at this level. This did not lead to an error because values at nl + 1 were not used. Removed test on ok_sync in phystokenc because it is not read at run time. Printing min and max of output NetCDF variables is heavy and archaic. Used histwrite_phy in phytrac.
Removed variables nk1 and nk in cv_driver and below. These arrays were just equal to the constant minorig. (This is also the case in LMDZ.) In cv_thermo, removed some variables which were copies of variables of suphec_m. Changed some variables to named constants.
In cv30_feed, iflag1 is 0 on entry so we can simplify the test for iflag1 = 7. In cv30_feed, for the computation of icb, replaced sequential search (with a useless end of loop on k) by a call to locate. In CV30 routines, replaced len, nloc, nd, na by klon or klev. Philosophy: no more generality than actually necessary. Converted as many variables as possible to named constants in cv30_param_m and downgraded pbcrit, ptcrit, dtovsh, dpbase, dttrig, tau, delta to local objects in procedures. spfac, betad and omtrain are useless and removed. Instead of filling the array sigp with the constant spfac in cv30_undilute2, just made sigp a constant in cv30_unsat. In cv_driver, define as allocatable variables that are only used on the range (ncum, nl).
Removed the possibility to read aerosol fields. This was not operational. It required fields already regridded in the three dimensions. It seems quite weird to me not to have online vertical regridding, since the surface pressure varies. There was the possibility of adding vertical regridding. But development is not in the spirit of LMDZE. Furthermore, the treatment of aerosols that was in LMDZE is completely obsolete in LMDZ. We could try importing the up-to-date treatment of aerosols of LMDZ, but that carries LMDZE quite far: there is the problem of the calendar and the problem of updated radiative transfer required for updated aerosols.
Extracted the call to read_comdissnew out of conf_gcm. Made ok_instan a variable of module clesphys, itau_phy a variable of module phyetat0_m, nid_ins a variable of module ini_histins_m, itap a variable of new module time_phylmdz, so that histwrite_phy can be called from any procedure without the need to cascade those variables into that procedure. Made itau_w a variable of module time_phylmdz so that it is computed only once per time step of physics. Extracted variables of module clesphys which were in namelist conf_phys_nml into their own namelist, clesphys_nml, and created procedure read_clesphys reading clesphys_nml, to avoid side effect. No need for double precision in procedure getso4fromfile. Assume there is a single variable for the whole year in the NetCDF file instead of one variable per month. Created generic procedure histwrite_phy and removed procedure write_histins, following LMDZ. histwrite_phy has only two arguments, can be called from anywhere, and should manage the logic of writing or not writing into various history files with various operations. So the test on ok_instan goes inside histwrite_phy. Test for raz_date in phyetat0 instead of physiq to avoid side effect. Created procedure increment_itap to avoid side effect. Removed unnecessary differences between procedures readsulfate and readsulfate_pi.
Created module cv_thermo_m around procedure cv_thermo. Moved variables from module cvthermo to module cv_thermo_m, where they are defined. In ini_histins and initphysto, using part of rlon and rlat from phyetat0_m is pretending that we do not know about the dynamical grid, while the way we extract zx_lon(:, 1) and zx_lat(1, :) depends on ordering inside rlon and rlat. So we might as well simplify and clarify by using directly rlonv and rlatu. Removed intermediary variables in write_histins and phystokenc.
There was a function gr_phy_write_3d in dyn3d and a function gr_phy_write_2d in module grid_change. Moved them into a new module gr_phy_write_m under a generic interface gr_phy_write. Replaced calls to gr_fi_ecrit by calls to gr_phy_write. Removed arguments len, nloc and nd of cv30_compress. Removed arguments wd and wd1 of cv30_uncompress, wd of cv30_yield, wd of concvl, wd1 of cv_driver. Was just filled with 0. Removed option ok_gust in physiq, never used. In cv30_unsat, cv30_yield and cv_driver, we only need to define b to level nl - 1.
Removed argument ncum of cv30_unsat, arguments nloc, ncum, nd, na of cv30_yield.
Made variable nl of module cv30_param_m a parameter. There was no coding allowing it to change. Removed arguments nloc and nd of cv30_undilute2, arguments nloc, nd and na of cv30_unsat. Just use klon and klev directly (going for clarity). Removed the option cvflag_grav = f. This was a lot of redundant code, probably obsolete, and cvflag_grav was initialized to true with no provision for changing it (as in LMDZ). In cv30_unsat, downdraft_loop started at i = nl + 1, but for i >= nl, i > inb, so num1 = 0.
Removed variables nlm and nlp of module cv30_param_m. We do not believe much in the benefit of these intermediary variables so we go for clarity. Removed variable noff of module cv30_param_m. Never used anywhere else. Just set the value of nl explicitly in cv30_param. Removed argument nd of cv30_param. Only called with nd = klev. Replaced calls to zilch by array assignments. There was a strange double call to zilch with the same arguments in cv30_mixing. Removed procedure cv_flag. Just set the value of variable cvflag_grav of module cvflag at declaration.
CV3 to CV30 (following LMDZ) (continued).
Removed argument snow_con of concvl. Just set snow_con to 0 in physiq instead of in concvl. Removed unused argument cbmf1 of cv_driver. Added computation and output of ptop (following LMDZ).
Replaced integer variable iflag_con of module clesphys2 by logical variable conv_emanuel.
Removed the option iflag_con == 4. This seems to be a coding of the Emanuel scheme equivalent to and older than the coding for iflag_con == 3.
In procedure concvl, renamed arguments snow to snow_con and ktop to itop_con (names of corresponding actual arguments in physiq). Removed useless argument pmflxs. Removed the alternative between iflag_con == 3 or 4, the same computations were done in both cases.
Moved variables date0, deltat, datasz_max, ncvar_ids, point, buff_pos, buffer, regular from module histcom_var to modules where they are defined. Removed procedure ioipslmpp, useless for a sequential program. Added argument datasz_max to histwrite_real (to avoid circular dependency with histwrite). Removed useless variables and computations everywhere. Changed real litteral constants from default kind to double precision in lwb, lwu, lwvn, sw1s, swtt, swtt1, swu. Removed unused arguments: paer of sw, sw1s, sw2s, swclr; pcldsw of sw1s, sw2s; pdsig, prayl of swr; co2_ppm of clmain, clqh; tsol of transp_lay; nsrf of screenp; kcrit and kknu of gwstress; pstd of orosetup. Added output of relative humidity.
Added argument itau_phy to ini_histins, phyetat0, phytrac and phyredem0. Removed variable itau_phy of module temps. Avoiding side effect in etat0 and phyetat0. The procedures ini_histins, phyetat0, phytrac and phyredem0 are all called by physiq so there is no cascading variable penalty. In procedure inifilr, made the condition on colat0 weaker to allow for rounding error. Removed arguments flux_o, flux_g and t_slab of clmain, flux_o and flux_g of clqh and interfsurf_hq, tslab and seaice of phyetat0 and phyredem. NetCDF variables TSLAB and SEAICE no longer in restartphy.nc. All these variables were related to the not-implemented slab ocean. seaice and tslab were just set to 0 in phyetat0 and never used nor changed. flux_o and flux_g were computed in clmain but never used in physiq. Removed argument swnet of clqh. Was used only to compute a local variable, swdown, which was not used.
correctbid did nothing. (Not used either in LMDZ since revision 1170.) Avoid aliasing in arguments of nat2gcm: use a single set of arguments with intent inout. Argument q of nat2gcm was not used. pres2lev now accepts po in any monotonic order. So the input files for nudging can now have the pressure coordinate in any order. Also, we read the latitude coordinate from the input files for nudging and we invert order if necessary so the input files for nudging can now have the latitude coordinate in any order. In pre2lev, no need for lmomx: use automatic arrays. Removed variable ncep of module conf_guide_m. Instead, we find out what the pressure coordinate is with find_coord.
Removed argument ierr of abort_gcm. It was always 1 and not used. Just encapsulated pres2lev into a module. Removed test on run_off in procedure calcul_fluxs. Useless. The test is always done just before in interfsurf_hq. Removed named constants rea and repsm in module suphec: never used.
Eignvectors computed by procedure jacobi are already normalized. No need to call acc.
In inifilr_hemisph, colat0 is necessarily >= 1. / rlamda(iim) (see notes) so we simplify the definition of jfilt. No need to keep modfrst values at other latitudes than the current one, and we can have one loop on latitudes instead of two. Just encapsulated transp into a module.
Added program test_inifilr. Encapsulated ppm3d into a module and added implicit none. Removed unused argument dum. Encountered a problem in procedure invert_zoom_x. With grossismx=2.9, DZOOMX=0.3, taux=5, for xuv = -0.25, for i = 1, rtsafe fails because fval is about 1e-16 instead of 0 at xval = pi. So distinguished the cases abs_y = 0 or pi. Needed then to add argument beta to invert_zoom_x. Moved the output of eignvalues of differentiation matrix from inifilr to inifgn, where they are computed. Simpler definition of j1 in inifilr.
Split ppm3d.f into files containing a single procedure. Factorized computations of filtering matrices into a procedure inifilr_hemisph. Had then to change the matrices from allocatable to pointer and from customized lower bound to lower bound 1. The change in lower bounds does not matter because the matrices are only used as a whole as actual arguments. Also, in infilr, instead of finding jfilt[ns][uv] from approximately jjm /2, start at index j1 that corresponds to the equator. This is not the same if there is a zoom in latitude. Also, the test (rlamda(modfrst[ns][uv](j)) * cos(rlat[uv](j)) < 1) in the loops on filtered latitudes is not useful now that we start from j1: it is necessarily true. See notes. Just encapsulated lwvn into a module and removed unused argument ktraer.
Variable pls of module pressure_var was only modified by calfis but I could not move it to module calfis_m because it was used by a procedure called by calfis (it would have been a cyclic dependency). In the same way, variable p3d of module pressure_var was only modified by leapfrog but I could not move it to module leapfrog_m. So removed module pressure_var. p3d becomes a local variable of leapfrog and an argument of calfis. Use paprs and play in regr_pr_int and regr_pr_av (following LMDZ). The idea in regr_pr_int and regr_pr_av is to spread and pack before the regridding instead of packing afterward. The cost in memory should only be a two-dimensional temporary array created by spread. The cost in clarity is only the transiting of paprs and pplay through regr_pr_comb_coefoz, but this is more than compensated by removing the side effect on module variables.
rlon[uv] and rlat[uv] are already in start.nc. Just encapsulated covcont in a module. finvmaold was not used in leapfrog. Downgraded it from dummy argument to local variable of SUBROUTINE integrd. Simplified handling of mass in integrd: down from five 3-dimensional arrays (masse, massem1, finvmaold, massescr and finvmasse) to three (masse, massem1, finvmaold).
Write variables from phytrac to "histins.nc" instead of "histrac.nc". The idea is to have different output files only if they have different coordinates, and not according to content (following LMDZ).
Subroutine sugwd sets variables of module yoegwd. Better to put it into module yoegwd. Variables of module yoegwd other than NKTOPG, NSTRA can be symbolic constants. sugwd now only sets NKTOPG, NSTRA. Simplified the computation of NKTOPG, NSTRA by making the local variable zpm1r an array instead of a scalar and calling ifirstloc.
Just encapsulated SUBROUTINE vlsplt in a module and cleaned it. In procedure vlx, local variables dxqu and adxqu only need indices iip2:ip1jm. Otherwise, just cleaned vlx. Procedures dynredem0 and dynredem1 no longer have argument fichnom, they just operate on a file named "restart.nc". The programming guideline here is that gcm should not be more complex than it needs by itself, other programs (ce0l etc.) just have to adapt to gcm. So ce0l now creates files "restart.nc" and "restartphy.nc". In order to facilitate decentralizing the writing of "restartphy.nc", created a procedure phyredem0 out of phyredem. phyredem0 creates the NetCDF header of "restartphy.nc" while phyredem writes the NetCDF variables. As the global attribute itau_phy needs to be filled in phyredem0, at the beginnig of the run, we must compute its value instead of just using itap. So we have a dummy argument lmt_pas of phyredem0. Also, the ncid of "startphy.nc" is upgraded from local variable of phyetat0 to dummy argument. phyetat0 no longer closes "startphy.nc". Following the same decentralizing objective, the ncid of "restart.nc" is upgraded from local variable of dynredem0 to module variable of dynredem0_m. "restart.nc" is not closed at the end of dynredem0 nor opened at the beginning of dynredem1. In procedure etat0, instead of creating many vectors of size klon which will be filled with zeroes, just create one array null_array. In procedure phytrac, instead of writing trs(: 1) to a text file, write it to "restartphy.nc" (following LMDZ). This is better because now trs(: 1) is next to its coordinates. We can write to "restartphy.nc" from phytrac directly, and not add trs(: 1) to the long list of variables in physiq, thanks to the decentralizing of "restartphy.nc". In procedure phyetat0, we no longer write to standard output the minimum and maximum values of read arrays. It is ok to check input and abort on invalid values but just printing statistics on input seems too much useless computation and out of place clutter.
Do not write any longer to startphy.nc nor read from restartphy.nc the NetCDF variable ALBLW: it was the same than ALBE. ALBE was for the visible and ALBLW for the near infrared. In physiq, use only variables falbe and albsol, removed falblw and albsollw. See revision 888 of LMDZ. Removed unused arguments pdp of SUBROUTINE lwbv, ptave of SUBROUTINE lwv, kuaer of SUBROUTINE lwvd, nq of SUBROUTINE initphysto.
Removed argument dtphys of physiq. Use it directly from comconst in physiq instead. Donwgraded variables eignfnu, eignfnv of module inifgn_m to dummy arguments of SUBROUTINE inifgn. They were not used elsewhere than in the calling procedure inifilr. Renamed argument dv of inifgn to eignval_v. Made alboc and alboc_cd independent of the size of arguments. Now we can call them only at indices knindex in interfsurf_hq, where we need them. Fixed a bug in alboc_cd: rmu0 was modified, and the corresponding actual argument in interfsurf_hq is an intent(in) argument of interfsurf_hq. Variables of size knon instead of klon in interfsur_lim and interfsurf_hq. Removed argument alb_new of interfsurf_hq because it was the same than alblw. Simplified test on cycle_diurne, following LMDZ. Moved tests on nbapp_rad from physiq to read_clesphys2. No need for separate counter itaprad, we can use itap. Define lmt_pas and radpas from integer input parameters instead of real-type computed values.
In procedure fxhyp, the convoluted computation of tanh(fa/fb) occurred three times. Extracted it into a function. Also, the computation of xmoy and fxm was repeated. So stored the values in arrays instead. In procedure fxhyp, in the computation of fhyp, there were tests xtild(i) == 0. and xtild(i) == pi_d. No use to do these tests at each iteration. We now they are true for i == nmax and i == 2 * nmax, respectively, and we know they are false for other values of "i". Similarly, in the computations of ffdx and xxpr, there were the tests xmoy == 0. and xmoy == pi_d, these could not be true. Moved files from bibio to dyn3d, following LMDZ.
Removed argument d of procedure acc. Was probably here just because automatic arrays were unknown. eigen_sort was eigsrt from Numerical Recipes. In procedure inifilr, create file "eignvl.txt" instead of writing to standard output.
Changed unit of variables lat_min_guide and lat_max_guide from module conf_guide_m from degrees to rad. Then we do not have to convert the whole array rlat from rad to degrees in SUBROUTINE tau2alpha. Removed some useless computations in inigeom. Removed module coefils. Moved variables sddv, unsddv, sddu, unsddu, eignfnu, eignfnv of module coefils to module inifgn_m. Downgraded variables coefilu, coefilu2, coefilv, coefilv2, modfrstu, modfrstv of module coefils to local variables of SUBROUTINE inifilr. Write and read a 3-dimensional variable Tsoil in restartphy.nc and startphy.nc instead of multiple variables for the different subs-urfaces and soil layers. This does not allow any longer to provide only the surface value in startphy.nc and spread it to other layers. Instead, if necessary, pre-process the file startphy.nc to spread the surface value.
dynetat0 read rlonu, rlatu, rlonv, rlatv, cu_2d, cv_2d, aire_2d from "start.nc" and then these variables were overwritten by inigeom. Corrected this. Now, inigeom does not compute rlonu, rlatu, rlonv and rlatv. Moreover, cu_2d, cv_2d, aire_2d are not written to "restart.nc". Since xprimu, xprimv, xprimm025, xprimp025, rlatu1, rlatu2, yprimu1, yprimu2 are computed at the same time as rlonu, rlatu, rlonv, rlatv, and since it would not be convenient to separate those computations, we decide to write xprimu, xprimv, xprimm025, xprimp025, rlatu1, rlatu2, yprimu1, yprimu2 into "restart.nc", read them from "start.nc" and not compute them in inigeom. So, in summary, "start.nc" contains all the coordinates and their derivatives, and inigeom only computes the 2D-variables. Technical details: Moved variables rlatu, rlonv, rlonu, rlatv, xprimu, xprimv from module comgeom to module dynetat0_m. Upgraded local variables rlatu1, yprimu1, rlatu2, yprimu2, xprimm025, xprimp025 of procedure inigeom to variables of module dynetat0_m. Removed unused local variable yprimu of procedure inigeom and corresponding argument yyprimu of fyhyp. Moved variables clat, clon, grossismx, grossismy, dzoomx, dzoomy, taux, tauy from module serre to module dynetat0_m (since they are read from "start.nc"). The default values are now defined in read_serre instead of in the declarations. Changed name of module serre to read_serre_m, no more module variable here. The calls to fxhyp and fyhyp are moved from inigeom to etat0. Side effects in programs other than gcm: etat0 and read_serre write variables of module dynetat0; the programs test_fxyp and test_inter_barxy need more source files. Removed unused arguments len and nd of cv3_tracer. Removed unused argument PPSOL of LWU. Bug fix in test_inter_barxy: forgotten call to read_serre.
Moved variable nb_files from module histcom_var to module histbeg_totreg_m. Removed unused argument q of writehist. No history file is created in program ce0l so there is no need to call histclo in etat0. In phyredem, access variables rlat and rlon directly from module phyetat0_m instead of having them as arguments. This is clearer for the program gcm. There are bad side effects for the program ce0l: we have to modify the module variables rlat and rlon in procedure etat0, and we need the additional file phyetat0.f to compile ce0l.
Removed unused argument missval in ma_fucoll_r[1-3]1, ma_fufill_r[1-3]1. Split filtreg into two procedures: filtreg_scal and filtreg_v. I did not like the test on the extent of the argument and there was no common code between the two cases: jjm and jjm + 1. Also, it is simpler now to just remove the argument "direct" from filtreg_v instead of allowing it and then stopping the program if it is false. Removed the computation of pkf in reanalyse2nat, was not used. As a consequence of the split of filtreg, had to extract the computation of pkf out of exner_hyb. This is clearer anyway because we want to be able to call exner_hyb with any size in the first two dimensions (as in test_disvert). But at the same time exner_hyb required particular sizes for the computation of pkf. It was awkward. The only computation of pkf is now in leapfrog.
Clarified the logic in filtreg by creating a procedure filtreg_hemisph. It was terrible with a loop on hemispheres and tests on hemisphere inside the loop, plus maddening indirections on latitude bounds, plus repeated code. Went from 126 lines to much clearer 74 + 32 = 106 lines. In module inifilr_m, finally made the arrays matrice[uv][ns], matrinv[ns] dynamic (following LMDZ). Changed the lower bound of matriceun and matrinvn in the 3rd dimension: 2 instead of 1, the index 1 was not defined (nor used). In module inifilr_m, changed the bounds of matriceus and matrinvs in the 3rd dimension: jfiltsu:jjm instead of 1:jjm - jfiltsu + 1. Changed the bounds of matricevs in the 3rd dimension: jfiltsv:jjm instead of 1:jjm - jfiltsv + 1. It is a little simpler and clearer this way in procedure inifilr.
Sources inside, compilation outside.
Removed procedure jacobi, which was a copy of the file from Numerical Recipes in Fortran 77. Refer to the Numer_Rec_95 library instead. There was a strange line in procedure coordij: j cannot be equal to 0 after the loop on j.
Renamed procedure fxhyp_loop_ik to invert_zoom_x. Bug fix. clat is now in rad so there should be no conversion in fyhyp. (This bug had an effect only if clat was /= 0.) No need for heavyside to be double precision. Removed variable tnom of module iniadvtrac_m. Was redundant with tname.
Removed arguments day0, anne0 of procedures initdynav and inithist. Use directly day_ref, annee_ref instead. Moved variables annee_ref, day_ref of module temps to module dynetat0_m. Deleted variables dayref and anneeref of module conf_gcm_m and removed them from namelist conf_gcm_nml. These variables were troubling intermediary on the way to annee_ref and day_ref. Gave as default values to annee_ref and day_ref the default values of dayref and anneeref. Moved the test on raz_date from main unit gcm to procedure dynetat0. Created namelist dynetat0_nml. Read annee_ref and day_ref from standard input in dynetat0 and redefine them from "start.nc" if not raz_date. Rationale: 1 - Choose the best programming from the point of view of program gcm only, forgetting program ce0l. 2 - The normal case is to define annee_ref and day_ref from "start.nc" so put them in module dynetat0_m rather than in conf_gcm_m. 3 - Try to always read the same namelists in the same order regardless of choices in previous namelists. Downsides: 1 -We now need the file "dynetat0.f" for the program ce0l, because dynetat0_m is used by dynredem0. 2 - We need to define annee_ref and day_ref from procedure etat0. Removed useless variable day_end of module temps.
clon and clat from module serre are now in rad instead of degrees. They are only used in rad, so we do only one conversion when we read them.
Created procedure read_yomcst. Deleted some intermediary variables in procedure orbit.
Moved some processing from fxhyp_loop_ik to fxhyp. Now fxhyp_loop_ik does not necessarily give longitudes near [-pi, pi]. In fxhyp, we look in rlonm025 whether we need to move the array toward [-pi, pi]. If so, we apply the same move to all grids: rlonm025, rlonv, rlonp025, rlonu and the corresponding derivatives. The move itself is done by the new procedure principal_cshift. This revision makes the logic clearer. (For example, we do not have a saved variable is2 in fxhyp_loop_ik any longer and we remove a test on ik in fxhyp_loop_ik.) Fixed a bad error message in fxhyp_loop_ik: talked about rlonu when xvrai is not always rlonu.
Added some test programs. In fxhyp_loop_ik, changed precision from 1e-3 to 1e-6. Reset initial value of xo1 to first guess of xi instead of final value of xi for previous i (better logic).
In procedure fxhyp, extracted the body of the loop on ik into a new procedure: fxhyp_loop_ik. dzoomx and dzoomy must now be fractions of the entire range, they cannot be ranges in degrees or rad. In fxhyp, force Xf(2 * nmax) = pi_d instead of possibly doing it in fxhyp_loop_ik. In fxhyp_loop_ik, when testing whether xvrai is between -pi and pi, changed the boundaries from -pi - 0.1 to - pi_d - 1d-5 and from pi + 0.1 to pi_d + 1d-5. This reveals a misconception of the code. Therefore, this version does not work.
In procedure fxhyp, removed the possibility to set scal180 to false. The useful lower bound of fhyp and xxpr is not 0. It does not make sense to give the save attribute to is2 since fxhyp is only called one per run. Bug fix: is2 could be used without being defined. The bug did not appear because is2 had the save attribute so it was initialized at 0.
Removed procedure fxyhyper. Useless intermediary between inigeom and fxhyp, fyhyp. Removed argument yprimv of fyhyp, not used in inigeom. Downgraded rlonm025 and rlonp025 from arguments to local variables of fxhyp, not used in inigeom. Downgraded arguments champmin, champmax of fxhyp and fyhyp to local variables: print them in fxhyp and fyhyp instead of fxyhyper. Removed arguments xzoomdeg, grossism, dzooma, tau of fxhyp. Use directly module variables clon, grossismx, dzoomx, taux instead. Removed arguments yzoomdeg, grossism, dzooma, tau of fyhyp. Use directly module variables clat, grossismy, dzoomy, tauy instead. In procedure yamada4, l0 does not need the save attribute. It is defined at each call.
In file grilles_gcm.nc, renamed variable phis to orog, deleted variable presnivs. Removed variable bug_ozone from module clesphys. In procedure ozonecm, moved computation of sint and cost out of the loops on horizontal position and vertical level. Inverted the order of the two loops. We can then move all computations from slat to aprim out of the loop on vertical levels. Created variable slat2, following LMDZ. Moved the limitation of column-density of ozone in cell at 1e-12 from radlwsw to ozonecm, following LMDZ. Removed unused arguments u, albsol, rh, cldfra, rneb, diafra, cldliq, pmflxr, pmflxs, prfl, psfl of phytrac. In procedure yamada4, for all the arrays, replaced the dimension klon by ngrid. At the end of the procedure, for the computation of kmn,kn, kq and q2, changed the upper limit of the loop index from klon to ngrid. In radlwsw, for the calculation of pozon, removed the factor paprs(iof+i, 1)/101325, as in LMDZ. In procedure sw, removed the factor 101325.0/PPSOL(JL), as in LMDZ.
Extracted code from tau2alpha for first call into new procedure init_tau2alpha. dxdys, dxdyu, dxdyv are now local variables if guide computed by init_tau2alpha. This allows us to remove terrible argument type of tau2alpha: we just give to tau2alpha the right dxdy and rlat. In module conf_guide_m, changed default values of tau_min_*, because 0.02 is too small for the default daystep = 240, iperiod = 5. Changed default values of guide_[uv] to false. Moved variable ok_guide from conf_gcm_m to conf_guide_m, ok_guide is no longer an input parameter, it is computed from guide_*. Had then to move test on ok_guide and day_step from conf_gcm_m to conf_guide_m. Added checks on input nudging parameters in procedure conf_guide. Upgraded variable factt to module conf_guide_m in order to check nudging parameters. Bug fix: variable guide_q was not in namelist conf_guide_nml. Removed unused variables aire_min, aire_max of MODULE guide_m. Moved the call to conf_guide from guide to gcm. This was needed to define ok_guide before getting into guide (since ok_guide is no longer in conf_gcm_m). Moved test on grossismx and grossismy from tau2alpha to guide. It is clearer now that only tau_max is used for a regular grid, and we do not have to repeat this test in each call to tau2alpha. In guide, we only call writefield when alpha is not a constant.
Moved the call to read_serre out of conf_gcm so that it can be called only in the program ce0l, not in gcm. In gcm, variables of module serre are read from start file. Added reading of dzoomx, dzoomy, taux, tauy from start file, in dynetat0. Those variables were written by dynredem0 but not read. Removed possibility fxyhypb = false, because the geometric part of the program is such a mess. Could then remove variables transx, transy, alphax, alphay, pxo, pyo of module serre. Bug fix in tau2alpha: missing save attributes. The first call to tau2alpha needs to compute dxdyu and dxdyv regardless of value of argument type, because they will be needed for subsequent calls to tau2alpha with various values of argument type.
Removed 8 first arguments of fxyhyper, use variables of module serre instead. Moved reading of variables of module serre from procedure conf_gcm to new procedure read_serre. In guide, added conditions to avoid useless calls to tau2alpha and writefield. Bugfix: offline corresponds to alpha = 1. Open only one NetCDF file to read number of vertical levels. In tau2alpha, added conditions to avoid useless computations of dxdyu and dxdyv. gamma is not needed for a regular grid.
Moved variables of module write_field to module createnewfield_m. Deleted module variable varid because we know that varid is always 1. Module variable record was modified in 2 procedures so Moved assignment: Record(NbField) = 1 to writefield.
Moved a call to writefield from guide to tau2alpha. (dxdys does not change with itau.) So dxdys does not need to be a module variable any longer. Other variables of modules tau2alpha_m downgraded to local variables of tau2alpha, since they were not used elsewhere. Procedures write_field[13]d and formcoord were never called. Could then remove int2str. Inline writefield_gen into writefield. CreateNewField takes an integer array argument instead of 3 scalar integers. CreateNewField now creates a number of dimensions adapted to the rank of the output field, instead of always 4 dimensions. Changed names of variables of module write_field: fieldid to ncid, fieldindex to record, fieldvarid to varid. In writefield_gen, if index == -1, no need to call GetFieldIndex again, we know that the result is nbfield. In guide, moved calls to writefield for some variables inside if first_call: those variables do not change with time. Removed ztau: computed only to be output, does not seem meaningful. Removed writefield for aire: does not change with time and is already in "grilles_gcm.nc".
Imported writefield from LMDZ. Close at the end of gcm the files which were created by writefiled (not done in LMDZ). Removed procedures for the output of Grads files. Removed calls to dump2d. In guide, replaced calls to wrgrads by calls to writefield. In vlspltqs, removed redundant programming of saturation pressure. Call foeew from module FCTTRE instead. Bug fix in interpre: size of w exceeding size of correponding actual argument wg in advtrac. In leapfrog, call guide until the end of the run, instead of six hours before the end. Bug fix in readsulfate_preind: type of arguments.
Imported procedure grilles_gcm_sub from LMDZ. Had then to transform local variable phis of etat to argument. Replaced calls to lnblnk by calls to trim. Removed arguments nlat, klevel and griscal of filtreg. Replaced integer arguments ifiltre and iaire by logical arguments direct and intensive. Changed default values of guide_t and guide_q to false.
Removed arguments klon, knon of interfoce_lim. Removed argument knon of interfsur_lim.
Removed procedure sortvarc0. Called sortvarc with an additional argument resetvarc instead. (Following LMDZ.) Moved current time computations and some printing statements from sortvarc to caldyn. Could then remove arguments itau and time_0 of sortvarc, and could remove "use dynetat0". Better to keep "dynetat0.f" as a gcm-only file. Moved some variables from module ener to module sortvarc. Split file "mathelp.f" into single-procedure files. Removed unused argument nadv of adaptdt. Removed dimension arguments of bernoui. Removed unused argument nisurf of interfoce_lim. Changed the size of argument lmt_sst of interfoce_lim from klon to knon. Removed case when newlmt is false. dynredem1 is called only once in each run, either ce0l or gcm. So variable nb in call to nf95_put_var was always 1. Removed variable nb. Removed dimension arguments of calcul_fluxs. Removed unused arguments precip_rain, precip_snow, snow of calcul_fluxs. Changed the size of all the arrays in calcul_fluxs from klon to knon. Removed dimension arguments of fonte_neige. Changed the size of all the arrays in fonte_neige from klon to knon. Changed the size of arguments tsurf and tsurf_new of interfsurf_hq from klon to knon. Changed the size of argument ptsrf of soil from klon to knon.
Renamed module cvparam to cv_param. Deleted procedure cv_param. Changed variables of module cv_param into parameters. In procedures cv_driver, cv_uncompress and cv3_uncompress, removed some arguments giving dimensions and used module variables klon and klev instead. In procedures gradiv2, laplacien_gam and laplacien, changed declarations of local variables because klevel is not always klev. Removed code for nudging surface pressure. Removed arguments pim and pjm of tau2alpha. Added assignment of false to variable first. Replaced real argument del of procedures foeew and FOEDE by logical argument.
Removed unused file "condsurf.f" (only useful for ocean slab). day_step must be a multiple of 4 * iperiod if ok_guide. Changed type of variable online of module conf_guide_m from integer to logical. Value -1 was not useful, equivalent to not ok_guide. Removed argument masse of procedure guide. masse is kept consistent with ps throughout the run. masse need only be computed again just after ps has been modified. In prodecure guide, replaced use of remanent variable first by test on itau. Replaced test on variable "test" by test on integer values. In leapfrog, for the call to guide, replaced test on real values by test on integer values. Bug fix in tau2alpha: computation of dxdyv (following LMDZ revision 1040). In procedure wrgrads, replaced badly chosen argument name "if" by i_f.
Removed unused files "interfoce_slab.f" and "gath2cpl.f". Removed unused variables coastalflow and riverflow of module interface_surf. Removed unused arguments cal, radsol, dif_grnd, fluxlat, fluxsens, dflux_s, dflux_l of procedure fonte_neige. Removed unused arguments tslab, seaice of procedure interfsurf_hq and clqh. Removed unused arguments seaice of procedure clmain. In interfsurf_hq, used variable soil_model of module clesphys2 instead of cascading it as an argument from physiq. In phyetat0, stop if masque not found. Variable TS instead of "TS[0-9][0-9]" in "(re)startphy.nc", with additional dimension nbsrf.
Removed unused variable tmp_rlic of module interface_surf. Removed useless call to gath2cpl in procedure interfsurf_hq. Removed then uncalled procedure gath2cpl.
Created procedure test_disvert (following LMDZ). Added procedures hybrid and funcd in module disvert_m. Upgraded compute_ab from internal procedure of disvert to module procedure. Added variables y, ya in module disvert_m. Upgraded s from local variable of procedure disvert to module variable. Renamed allowed value of variable vert_sampling in procedure disvert from "read" to "read_hybrid". Added possibility to read pressure values, value "read_pressure". Replaced vertical distribution for value "param" by the distribution "strato_correct" from LMDZ (but kept the value "param"). In case "tropo", replaced 1 by dsigmin (following LMDZ). In case "strato", replaced 0.3 by dsigmin (following LMDZ). Changed computation of bp in procedure compute_ab. Removed debugindex case in clmain. Removed useless argument rlon of procedure clmain. Removed useless variables ytaux, ytauy of procedure clmain. Removed intermediary variables tsol, qsol, tsolsrf, tslab in procedure etat0. Removed variable ok_veget:. coupling with the model Orchid is not possible. Removed variable ocean: modeling an ocean slab is not possible. Removed useless variables tmp_rriv and tmp_rcoa from module interface_surf. Moved initialization of variables da, mp, phi in procedure physiq to to inside the test iflag_con >= 3.
Split inter_barxy.f : one procedure per module, one module per file. Grouped the files into a directory. Split orbite.f. Value of raz_date read from the namelist is taken into account (resetting the step counter) even if annee_ref == anneeref and day_ref == dayref. raz_date is no longer modified by gcm main unit. (Following LMDZ.) Removed argument klon of interfsur_lim. Renamed arguments lmt_alb, lmt_rug to alb_new, z0_new (same name as corresponding actual arguments in interfsurf_hq). Removed argument klon of interfsurf_hq. Removed arguments qs and d_qs of diagetpq. Were always zero. Downgraded arguments d_qw, d_ql of diagetpq to local variables, they were not used in physiq. Removed all computations for solid water in diagetpq, was just zero. Downgraded arguments fs_bound, fq_bound of diagphy to local variables, they were not used in physiq. Encapsulated in a test on iprt all computations in diagphy. Removed parameter nbtr of module dimphy. Replaced it everywhere in the program by nqmx - 2. Removed parameter rnpb of procedure physiq. Kept the true case in physiq and phytrac. Could not work with false case anyway. Removed arguments klon, llm, airephy of qcheck. Removed argument ftsol of initrrnpb, was not used.
Module pressure_var is now only used in gcm. Created local variables pls and p3d in etat0, added argument p3d to regr_pr_o3. In leapfrog, moved computation of p3d and exner function immediately after integrd, for clarity (does not change the execution). Removed unused arguments: ntra, tra1 and tra of cv3_compress; ntra, tra and traent of cv3_mixing; ntra, ftra, ftra1 of cv3_uncompress; ntra, tra, trap of cv3_unsat; ntra, tra, trap, traent, ftra of cv3_yield; tra, tvp, pbase, bbase, dtvpdt1, dtvpdq1, dplcldt, dplcldr, ntra of concvl; ndp1, ntra, tra1 of cv_driver Removed argument d_tra and computation of d_tra in concvl. Removed argument ftra1 and computation of ftra1 in cv_driver. ftra1 was just set to 0 in cv_driver, associated to d_tra in concvl, and set again to zero in concvl.
Grouped compilation files into directory Compilation.
Moved variable calendar_used, un_an and mon_len from module calendar to module ioconf_calendar_m. Removed unused variables cal, start_day, start_sec of module calendar. Inlined procedure ju2ymds_internal into procedure ju2ymds. Inlined procedure ymds2ju_internal into procedure ymds2ju. Removed generic interface ioget_calendar. Merged ioget_calendar_real1 and ioget_calendar_real2 into ioget_calendar_real.
Extracted procedures that were in module calendar into separate files.
Removed unused variables lock_startdate and time_stamp of module calendar. Noticed that physiq does not change the surface pressure. So removed arguments ps and dpfi of subroutine addfi. dpfi was always 0. The computation of ps in addfi included some averaging at the poles. In principle, this does not change ps but in practice it does because of finite numerical precision. So the results of the simulation are changed. Removed arguments ps and dpfi of calfis. Removed argument d_ps of physiq. du at the poles is not computed by dudv1, so declare only the corresponding latitudes in dudv1. caldyn passes only a section of the array dudyn as argument. Removed variable niadv of module iniadvtrac_m. Declared arguments of exner_hyb as assumed-shape arrays and made all other horizontal sizes in exner_hyb dynamic. This allows the external program test_disvert to use exner_hyb at a single horizontal position.
Removed procedures ini_histday, ini_histhf, write_histday and write_histhf. Divided file regr_pr_coefoz.f into regr_pr_av.f and regr_pr_int.f. (Following LMDZ.) Divided module regr_pr_coefoz into modules regr_pr_av_m and regr_pr_int_m. Renamed regr_pr_av_coefoz to regr_pr_av and regr_pr_int_coefoz to regr_pr_int. The idea is that those procedures are more general than Mobidic. Removed argument dudyn of calfis and physiq. dudyn is not used either in LMDZ. Removed computation in calfis of unused variable zpsrf (not used either in LMDZ). Removed useless computation of dqfi in calfis (part 62): the results were overwritten. (Same in LMDZ.)
Removed call to pvtheta in calfis because the result pvteta is not used (not used either in LMDZ). Removed unused argument dv of calfis. (Corresponding argument in LMDZ is pdvcov and computations from pdvcov are made in calfis but not used.) Removed procedures that were not called.
Removed useless argument mode of subroutine read_reanalyse.
In procedure exner_hyb, removed computation of pks at the poles. In the program ce0l, start_init_dyn ensures that there is a single value of ps at each pole. In the program gcm, ps received by exner_hyb always has a single value at each pole. Hence, so does pks. This modification changes the results of ce0l and gcm.
In procedure conf_guide, replaced calls to getpar by reading a namelist. Removed file getparam.f, now unused. So getin of IOIPSL is now unused too. Removed files getincom.f, getincom2.f, cmpblank.f, find_sig.f, gensig.f and nocomma.f. Moved variables lat_min_guide and lat_max_guide from module tau2alpha_m to module conf_guide_m. Removed variables nivsig and nivsigs of module disvert_m. Instead, in initdynav and initfluxsto, directly wrote arithmetic sequence for verical axis, pending a better vertical axis. Removed variables nivsig and nivsigs of "(re)?.start.nc". In procedure exner_hyb, replaced p(:, :, 1) by equivalent ps.
Moved procedure iniconst inside module comconst. Removed useless variables of module comconst: im, jm, lllm, imp1, jmp1, lllmm1, lllmp1, lcl, cotot, unsim. Move definition of dtvr that was in dynetat0 and etat0 to iniconst. Moved comparison of dtvr from day_step and start.nc that was in gcm to dynetat0. Moved call to disvert out of iniconst. Moved call to iniconst in gcm before call to dynetat0. Removed unused argument pvteta of physiq (not used either in LMDZ).
Moved procedure inigeom into module comgeom. In disvert, renamed s_sampling to vert_sampling, following LMDZ. Removed choice strato1. In case read, read ap and bp instead of s (following LMDZ). Added argument phis to start_init_orog and start_init_dyn, and removed variable phis of module start_init_orog_m. In etat0 and start_init_orog, renamed relief to zmea_2d. In start_init_dyn, renamed psol to ps. In start_init_orog, renamed relief_hi to relief. No need to set phis(iim + 1, :) = phis(1, :), already done in grid_noro. Documentation for massbar out of SVN, in massbar.txt. Documentation was duplicated in massdair, but not relevant in massdair. In conflx, no need to initialize pen_[ud] and pde_[ud]. In flxasc, used intermediary variable fact (following LMDZ). In grid_noro, added local variable zmea0 for zmea not smoothed and computed zphi from zmea instead of zmea0 (following LMDZ). This changes the results of ce0l. Removed arguments pen_u and pde_d of phytrac and nflxtr, which were not used.
Moved everything out of libf.
Flincom is not used any longer.
Renamed tpot to teta and psol to ps in etat0. Replaced calls to flincom by calls to NetCDF95 in startdyn. lon_ini, lat_ini and levdyn_ini are now pointers.
NaN to signalling NaN in gfortran_debug.mk. Removed unused procedures in getincom and getincom2. In procedure conf_interface, replaced call to getincom by new namelist. Moved procedure conf_interface into module interface_surf. Added variables sig1 and w01 to startphy.nc and restartphy.nc, for procedure cv_driver. Renamed (ema_)?work1 and (ema_)?work2 to sig1 and w01 in concvl and physiq. Deleted unused arguments of clmain, clqh and intersurf_hq, among which (y)?sollwdown. Following LMDZ, in physiq, read sollw instead of sollwdown from startphy.nc, write sollw instead of sollwdown to restartphy.nc. In procedure sw, initialized zfs[ud][pn]a[di], for runs where ok_ade and ok_aie are false. (Following LMDZ.) Added dimension klev to startphy.nc and restartphy.nc, and deleted dimension horizon_vertical. Made t_ancien and q_ancien two-dimensional NetCDF variables. Bug fix: in phyetat0, define ratqs, clwcon and rnebcon for vertical levels >=2. Bug fix: set mfg, p[de]n_[ud] to 0. when iflag_con >= 3. (Following LMDZ.)
No reason to call inidissip in ce0l. In inidissip, set random seed to 1 beacuse PGI compiler does not accept all zeros. dq was computed needlessly in caladvtrac. Arguments masse and dq of calfis not used. Replaced real*8 by double precision. Pass arrays with inverted order of vertical levels to conflx instead of creating local variables for this inside conflx.
In procedure, "addfi" access directly the module variable "dtphys" instead of going through an argument. In "conflx", do not create a local variable for temperature with reversed order of vertical levels. Instead, give an actual argument with reversed order in "physiq". Changed names of variables "rmd" and "rmv" from module "suphec_m" to "md" and "mv". In "hgardfou", print only the first temperature out of range found.
Deleted files cvparam3.f90 and nuagecom.f90. Moved variables from module cvparam3 to module cv3_param_m. Moved variables rad_chau1 and rad_chau2 from module nuagecom to module conf_phys_m. Read clesphys2_nml from conf_phys instead of gcm. Removed argument iflag_con from several procedures. Access module variable instead.
Split "flincom.f90" into "flinclo.f90", "flinfindcood.f90", "flininfo.f90" and "flinopen_nozoom.f90", in directory "IOIPSL/Flincom". Renamed "etat0_lim" to "ce0l", as in LMDZ. Split "readsulfate.f" into "readsulfate.f90", "readsulfate_preind.f90" and "getso4fromfile.f90". In etat0, renamed variable q3d to q, as in "dynredem1". Replaced calls to Flicom procedures by calls to NetCDF95. In leapfrog, added call to writehist. Extracted ASCII art from "grid_noro" into a file "grid_noro.txt". Transformed explicit-shape local arrays into automatic arrays, so that test on values of iim and jjm is no longer needed. Test on weight: IF (weight(ii, jj) /= 0.) THEN is useless. There is already a test before: if (any(weight == 0.)) stop "zero weight in grid_noro" In "aeropt", replaced duplicated lines with different values of inu by a loop on inu. Removed arguments of "conf_phys". Corresponding variables are now defined in "physiq", in a namelist. In "conf_phys", read a namelist instead of using getin.
Cleaning.
Changed name of module "comvert" to "disvert_m". Changed constant 1. to 0.3 in vertical sampling "strato".
Removed unused procedure "divgrad". In procedure "dissip", save memory by using intermediary arrays "gdx" and "gdy" several times instead of additional array "grx" and "gry". In procedure "inidissip", write "dtdiss * teta*" instead of "teta*". In "comvert", change name of s_sampling from "LMD5" to "tropo" and from "strato2" to "strato".
Removed variable lstardis in module comdissnew and procedures gradiv and nxgrarot. lstardir had to be true. gradiv and nxgrarot were called if lstardis was false. Removed argument iter of procedure filtreg. iter had to be 1. gradiv and nxgrarot called filtreg with iter == 2. Moved procedure flxsetup into module yoecumf. Module yoecumf is only used in program units of directory Conflx, moved it there.
Superficial changes
Changed handling of compiler in compilation system. Removed the prefix letters "y", "p", "t" or "z" in some names of variables. Replaced calls to NetCDF by calls to NetCDF95. Extracted "ioget_calendar" procedures from "calendar.f90" into a separate file. Extracted to a separate file, "mathop2.f90", procedures that were not part of the generic interface "mathop" in "mathop.f90". Removed computation of "dq" in "bilan_dyn", which was not used. In "iniadvtrac", removed schemes 20 Slopes and 30 Prather. Was not compatible with declarations of array sizes. In "clcdrag", "ustarhb", "vdif_kcay", "yamada4" and "coefkz", changed the size of some arrays from "klon" to "knon". Removed possible call to "conema3" in "physiq". Removed unused argument "cd" in "yamada".
No more included file in LMDZE, not even "netcdf.inc". Created a variable containing the list of common source files in GNUmakefile. So we now also see clearly files that are specific to each program. Split module "histcom". Assembled resulting files in directory "Histcom". Removed aliasing in calls to "laplacien".
Useless copies into "gdx" and "gdy" in "gradiv2".
Write used namelists to file "" instead of standard output. Avoid aliasing in "inidissip" in calls to "divgrad2", "divgrad", "gradiv2", "gradiv", "nxgraro2" and "nxgrarot". Add a degenerate dimension to arrays so they have rank 3, like the dummy arguments in "divgrad2", "divgrad", "gradiv2", "gradiv", "nxgraro2" and "nxgrarot". Extract the initialization part from "bilan_dyn" and make a separate procedure, "init_dynzon", from it. Move variables from modules "iniprint" and "logic" to module "conf_gcm_m". Promote internal procedures of "fxy" to private procedures of module "fxy_m". Extracted documentation from "inigeom". Removed useless "save" attributes. Removed useless intermediate variables. Extracted processing of poles from loop on latitudes. Write coordinates to file "longitude_latitude.txt" instead of standard output. Do not use ozone tracer for radiative transfer.
Imported "writehist.f" from LMDZ. Moved module variable "histaveid" from "com_io_dyn" to "initdynav_m". In "inithist", access directly module variables from "com_io_dyn" instead of going through the arguments. Copying from LMDZ, write "u" and scalar variables to separate files. Create a new variable for the new file in "com_io_dyn". Copying from LMDZ, change the vertical axes of the three files. Removed some useless initializations in "dissip". In "bilan_dyn", removed useless variable "time". Avoiding the approximate test on "dt_cum" being a multiple of "dt_app", just compute "ncum" from known usage of "bilan_dyn" and compute "dt_cum" from "ncum". Change "periodav" from real to integer in "conf_gcm_m". Since "day_step" is required to be a multiple of "iperiod", so is "ncum".
-- In procedure "bilan_dyn", replaced average of "zvq" by integral of "zvq", following a comment of Francis Codron : Le calcul actuel donne des unités peu pratiques : transports de chaleur en K m / s par exemple. C'est bien pour les sorties à 2 dimensions, latitude et pression, car alors le transport ne dépend pas de l'espacement des niveaux, mieux pour comparer ou tracer en latitude et pression. Par contre, quand on somme sur la verticale, on préfèrerait avoir des transports d'énergie en watts, ou au moins an K kg / s (à multiplier par "Cp" ou "L"). On doit pouvoir recalculer le transport intégré à partir des fichiers de sortie, mais c'est embêtant (calcul de "cv"). -- Gathered files in directory Dissipation.
Removed Numerical Recipes procedure "ran1". Replaced calls to "ran1" in "inidissip" by calls to intrinsic procedures. Split file "interface_surf.f90" into a file with a module containing only variables, "interface_surf", and single-procedure files. Gathered files into directory "Interface_surf". Added argument "cdivu" to "gradiv" and "gradiv2", "cdivh" to "divgrad2" and "divgrad", and "crot" to "nxgraro2" and "nxgrarot". "dissip" now uses variables "cdivu", "cdivh" and "crot" from module "inidissip_m", so it can pass them to "gradiv2", etc. Thanks to this modification, we avoid a circular dependency betwwen "inidissip.f90" and "gradiv2.f90", etc. The value -1. used by "gradiv2", for instance, during computation of eigenvalues is not the value "cdivu" computed by "inidissip". Extracted procedure "start_inter_3d" from module "startdyn", to its own module. In "inidissip", unrolled loop on "ii". I find it clearer now. Moved variables "matriceun", "matriceus", "matricevn", "matricevs", "matrinvn" and "matrinvs" from module "parafilt" to module "inifilr_m". Moved variables "jfiltnu", "jfiltnv", "jfiltsu", "jfiltsv" from module "coefils" to module "inifilr_m".
Split "conflx.f" into single-procedure files in directory "Conflx". Split "cv_routines.f" into single-procedure files in directory "CV_routines". Made module "cvparam" from included file "cvparam.h". No included file other than "netcdf.inc" left in LMDZE.
Split "getincom.f90" into "getincom.f90" and "getincom2.f90". Split "nuage.f" into "nuage.f90", "diagcld1.f90" and "diagcld2.f90". Created module "chem" from included file "chem.h". Moved "YOEGWD.f90" to directory "Orography". In "physiq", for evaporation of water, "zlsdcp" was equal to "zlvdc". Removed useless variables.
LMDZE now uses library Jumble. Removed all calls to "flinget". Replaced calls to "flinget", "flininfo", "flinopen_nozoom" by calls to NetCDF95 and Jumble. Split file "cv_driver.f" into "cv_driver.f90", "cv_flag.f90" and "cv_thermo.f90". Bug fix: "QANCIEN" was read twice in "phyeytat0". In "physiq", initialization of "d_t", "d_u", "d_v" was useless.
Replaced calls to "flinget" by calls to "NetCDF95".
Split "thermcell.f" and "cv3_routines.f". Removed copies of files that are now in "L_util". Moved "mva9" and "diagetpq" to their own files. Unified variable names across procedures.
Removed procedure "psextbar". "psextbar" was called but the result of the call was not used.
Split file "histwrite.f90" into "histwrite.f90", "histwrite_real.f90" and "histvar_seq.f90". Extracted documentation from "psextbar.f" into "psextbar.txt" (out of SVN).
Removed argument "pdteta" of "calfis", because it was not used. Created module "conf_guide_m", containing procedure "conf_guide". Moved module variables from "guide_m" to "conf_guide_m". In module "getparam", removed "ini_getparam" and "fin_getparam" from generic interface "getpar". Created module variables in "tau2alpha_m" to replace common "comdxdy".
"start_init_phys" is now called directly by "etat0" instead of through "start_init_dyn". "qsol_2d" is no longer a variable of module "start_init_phys_m", it is an argument of "start_init_phys". "start_init_dyn" now receives "tsol_2d" from "etat0". Split file "vlspltqs.f" into "vlspltqs.f90", "vlxqs.f90" and ""vlyqs.f90". In "start_init_orog", replaced calls to "flin*" by calls to NetCDF95.
"alpha" useless, always 0, in "exner_hyb".
"pi" comes from "nr_util". Removed subroutine "initialize" in module "comconst". Copied the content of "fxy_sin.h" into "fxysinus", instead of getting it from an "include" line. Removed file "fxy_sin.h". "ps" has rank 2 in "gcm" and "dynetat0". Assumed-shape for argument "q" of "integrd".
Extracted ASCII art from "inigeom" into a separate text file in the documentation. "test_disvert" now creates a separate file for layer thicknesses. Moved variables from module "yomcst" to module "suphec_m" because this is where those variables are defined. Kept in "yomcst" only parameters of Earth orbit. Gave the attribute "parameter" to some variables of module "suphec_m". Variables of module "yoethf" were defined in procedure "suphec". Moved these definitions to a new procedure "yoethf" in module "yoethf_m".
Inlined procedure "pression". Split "guide.f90" into "guide.f90" and "tau2alpha.f90". Split "read_reanalyse.f" into single-procedure files in directory "Read_reanalyse". Useless copy of variables in "iniphysiq". Directly define module variables in "gcm" and remove procedure "iniphysiq". Added "pressure-altitude" in "test_disvert".
Now using the library "NR_util".
Split "ini_hist.f90" into single-procedure files. In "calfis" and "physiq", removed dummy argument "nq" since "nq" must be equal to "nqmx". In "calfis", renamed dummy argument "pq" to "q", same name as actual argument in "leapfrog". Renamed local variable "zqfi" to "qx", same name as dummy argument in "physiq". Removed arguments "itop_con" and "ibas_con" of "phytrac", which were not used.
Test namelist input in procedure "conf_gcm" rather than program unit "gcm". Compute "time" in procedure "sortvarc" rather than "leapfrog". Rewrote "leapfrog" with a single loop on "itau" instead of two nested loops on number of periodic matsuno-leapfrog cycles and leapfrog iterations.
Split "stringop.f90" into single-procedure files. Gathered files in directory "IOIPSL/Stringop". Split "flincom.f90" into "flincom.f90" and "flinget.f90". Removed unused procedures from module "flincom". Removed unused argument "filename" of procedure "flinopen_nozoom". Removed unused files. Split "grid_change.f90" into "grid_change.f90" and "gr_phy_write_3d.f90". Removed unused procedures from modules "calendar", "ioipslmpp", "grid_atob", "gath_cpl" and "getincom". Removed unused procedures in files "ppm3d.f" and "thermcell.f". Split "mathelp.f90" into "mathelp.f90" and "mathop.f90". Removed unused variable "dpres" of module "comvert". Use argument "itau" instead of local variables "iadvtr" and "first" to control algorithm in procedure "fluxstokenc". Removed unused arguments of procedure "integrd". Removed useless computations at the end of procedure "leapfrog". Merged common block "matrfil" into module "parafilt".
Split "vlsplt.f" in single-procedure files. Gathered the files in directory "dyn3d/Vlsplt". Defined "pbarum(:, 1, :)" and "pbarum(:, jjm + 1, :)" in procedure "groupe".
Imported Source files of the external library "IOIPSL_Lionel" into "libf/IOIPSL". Split "cray.f90" into "scopy.f90" and "ssum.f90". Rewrote "leapfrog" in order to have a clearer algorithmic structure.
Removed unused "diagedyn.f" and "undefSTD.f". In "etat0", the variable "dt" of module "temps" was defined from "landicered.nc", which was meaningless and useless. Replaced "dt" by a local trash variable. Removed variable "dt" from module "temps" and created instead a local variable of "leapfrog" and an argument of "integrd".
"dyn3d" and "filtrez" do not contain any included file so make rules have been updated. "comdissip.f90" was useless, removed it. "dynredem0" wrote undefined value in "controle(31)", that was overwritten by "dynredem1". Now "dynredem0" just writes 0 to "controle(31)". Removed arguments of "inidissip". "inidissip" now accesses the variables by use association. In program "etat0_lim", "itaufin" is not defined so "dynredem1" wrote undefined value to "controle(31)". Added argument "itau" of "dynredem1" to correct that. "itaufin" does not need to be a module variable (of "temps"), made it a local variable of "leapfrog". Removed calls to "diagedyn" from "leapfrog".
Moved variable "dtdiss" from module "comconst", variable "idissip" from module "conf_gcm_m" and all variables from module "comdissipn" to module "inidissip_m". "inidissip" creates file "inidissip.csv". "idissip" is no longer read from a namelist. Removed useless computation of "dtdiss" in procedure "iniconst".
Simplified "etat0_lim.sh" and "gcm.sh" because the full versions depended on personal arrangements for directories and machines. Translated included files into modules. Encapsulated procedures into modules. Moved variables from module "comgeom" to local variables of "inigeom". Deleted some unused variables in "comgeom". Moved variable "day_ini" from module "temps" to module "dynetat0_m". Removed useless test on variable "time" and useless "close" statement in procedure "leapfrog". Removed useless call to "inigeom" in procedure "limit".
Created directory "phylmd/Radlwsw". Split "radlwsw.f" in files containing a single procedure. Removed variable "itaufinp1" in "leapfrog".
Split "orografi.f": one file for each procedure. Put the created files in new directory "Orography". Removed argument "vcov" of procedure "sortvarc". Removed arguments "itau" and "time" of procedure "caldyn0". Removed arguments "itau", "time" and "vcov" of procedure "sortvarc0". Removed argument "time" of procedure "dynredem1". Removed NetCDF variable "temps" in files "start.nc" and "restart.nc", because its value is always 0. Removed argument "nq" of procedures "iniadvtrac" and "leapfrog". The number of "tracers read in "traceur.def" must now be equal to "nqmx", or "nqmx" must equal 4 if there is no file "traceur.def". Replaced variable "nq" by constant "nqmx" in "leapfrog". NetCDF variable for ozone field in "coefoz.nc" must now be called "tro3" instead of "r". Fixed bug in "zenang".
Superficial modifications
Deleted argument "presnivs" of "physiq", "ini_histhf", "ini_histhf3d", "ini_histday", "ini_histins", "ini_histrac", "phytrac". Access it from "comvert" instead. Replaced calls to NetCDF Fortran 77 interface by calls to Fortran 90 interface or to NetCDF95. Procedure "gr_phy_write_3d" now works with a variable of arbitrary size in the second dimension. Annotated use statements with "only" clause. Replaced calls to NetCDF interface version 2 by calls to Fortran 90 interface in "guide.f90" and "read_reanalyse.f". In "write_histrac", replaced calls to "gr_fi_ecrit" by calls to "gr_phy_write_2d" and "gr_phy_write_3d".
Inlined procedures "regr_pr_av" and "regr_pr_int" in "regr_pr_o3", "regr_pr_av_coefoz" and "regr_pr_int_coefoz".
In module "regr_pr", rewrote scanning of horizontal positions as a single set of loops, using a mask. Added some "intent" attributes. In "dynredem0", replaced calls to Fortran 77 interface of NetCDF by calls to NetCDF95. Removed calls to "nf_redef", regrouped all writing operations. In "dynredem1", replaced some calls to Fortran 77 interface of NetCDF by calls to Fortran 90 interface. Renamed variable "nqmax" to "nq_phys". In "physiq", if "nq >= 5" then "wo" is computed from the parameterization of "Cariolle".
Created rule for "compare_sampl_*" files in "Documentation/Manuel_LMDZE.texfol/Graphiques/GNUmakefile". Extracted "qcheck", "radiornpb", "minmaxqfi" into separate files. Read pressure coordinate of ozone coefficients once per run instead of every day. Added some "intent" attributes. Added argument "nq" to "ini_histday". Replaced calls to "gr_fi_ecrit" by calls to "gr_phy_write_2d". "Sigma_O3_Royer" is written to "histday.nc" only if "nq >= 4". Moved "ini_histrac" to module "ini_hist". Compute "zmasse" in "physiq", pass it to "phytrac". Removed computations of "pftsol*" and "ppsrf*" in "phytrac". Do not use variable "rg" from module "YOMCST" in "TLIFT".
-- Minor modification of input/output: Added variable "Sigma_O3_Royer" to "histday.nc". "ecrit_day" is not modified in "physiq". Removed variables "pyu1", "pyv1", "ftsol1", "ftsol2", "ftsol3", "ftsol4", "psrf1", "psrf2", "psrf3", "psrf4" "mfu", "mfd", "en_u", "en_d", "de_d", "de_u", "coefh" from "histrac.nc". Variable "raz_date" of module "conf_gcm_m" has logical type instead of integer type. -- Should not change any result at run time: Modified calls to "IOIPSL_Lionel" procedures because the interfaces of these procedures have been simplified. Changed name of variable in module "start_init_orog_m": "masque" to "mask". Created a module containing procedure "phyredem". Removed arguments "punjours", "pdayref" and "ptimestep" of procedure "iniphysiq". Renamed procedure "gr_phy_write" to "gr_phy_write_2d". Created procedure "gr_phy_write_3d". Removed procedures "ini_undefstd", "moy_undefSTD", "calcul_STDlev", "calcul_divers".
-- Minor change of behaviour: "etat0" does not compute "rugsrel" nor "radpas". Deleted arguments "radpas" and "rugsrel" of "phyredem". Deleted argument "rugsrel" of "phyetat0". "startphy.nc" does not contain the variable "RUGSREL". In "physiq", "rugoro" is set to 0 if not "ok_orodr". The whole program "etat0_lim" does not use "clesphys2". -- Minor modification of input/output: Created subroutine "read_clesphys2". Variables of "clesphys2" are read in "read_clesphys2" instead of "conf_gcm". "printflag" does not print variables of "clesphys2". -- Should not change any result at run time: References to module "numer_rec" instead of individual modules of "Numer_rec_Lionel". Deleted argument "clesphy0" of "calfis", "physiq", "conf_gcm", "leapfrog", "phyetat0". Deleted variable "clesphy0" in "gcm". "phyetat0" does not modify variables of "clesphys2". The program unit "gcm" does not modify "itau_phy". Added some "intent" attributes. "regr11_lint" does not call "polint".
-- Minor modification of input/output: Created procedure "read_logic". Variables of module "logic" are read by "read_logic" instead of "conf_gcm". Variable "offline" of module "conf_gcm" is read from namelist instead of "*.def". Deleted arguments "dtime", "co2_ppm_etat0", "solaire_etat0", "tabcntr0" and local variables "radpas", "tab_cntrl" of "phyetat0". "phyetat0" does not read "controle" in "startphy.nc" any longer. "phyetat0" now reads global attribute "itau_phy" from "startphy.nc". "phyredem" does not create variable "controle" in "startphy.nc" any longer. "phyredem" now writes global attribute "itau_phy" of "startphy.nc". Deleted argument "tabcntr0" of "printflag". Removed diagnostic messages written by "printflag" for comparison of the variable "controle" of "startphy.nc" and the variables read from "*.def" or namelist input. -- Removing unwanted functionality: Removed variable "lunout" from module "iniprint", replaced everywhere by standard output. Removed case "ocean == 'couple'" in "clmain", "interfsurf_hq" and "physiq". Removed procedure "interfoce_cpl". -- Should not change anything at run time: Automated creation of graphs in documentation. More documentation on input files. Converted Fortran files to free format: "phyredem.f90", "printflag.f90". Split module "clesphy" into "clesphys" and "clesphys2". Removed variables "conser", "leapf", "forward", "apphys", "apdiss" and "statcl" from module "logic". Added arguments "conser" to "advect", "leapf" to "integrd". Added local variables "forward", "leapf", "apphys", "conser", "apdiss" in "leapfrog". Added intent attributes. Deleted arguments "dtime" of "phyredem", "pdtime" of "flxdtdq", "sh" of "phytrac", "dt" of "yamada". Deleted local variables "dtime", "co2_ppm_etat0", "solaire_etat0", "length", "tabcntr0" in "physiq". Replaced all references to "dtime" by references to "pdtphys".
Added NetCDF directory "/home/guez/include" in "g95.mk" and "nag_tools.mk". Added some "intent" attributes in "PVtheta", "advtrac", "caladvtrac", "calfis", "diagedyn", "dissip", "vlspltqs", "aeropt", "ajsec", "calltherm", "clmain", "cltrac", "cltracrn", "concvl", "conema3", "conflx", "fisrtilp", "newmicro", "nuage", "diagcld1", "diagcld2", "drag_noro", "lift_noro", "SUGWD", "physiq", "phytrac", "radlwsw", "thermcell". Removed the case "ierr == 0" in "abort_gcm"; moved call to "histclo" and messages for end of run from "abort_gcm" to "gcm"; replaced call to "abort_gcm" in "leapfrog" by exit from outer loop. In "calfis": removed argument "pp" and variable "unskap"; changed "pksurcp" from scalar to rank 2; use "pressure_var"; rewrote computation of "zplev", "zplay", "ztfi", "pcvgt" using "dyn_phy"; added computation of "pls". Removed unused variable in "dynredem0". In "exner_hyb": changed "dellta" from scalar to rank 1; replaced call to "ssum" by call to "sum"; removed variables "xpn" and "xps"; replaced some loops by array expressions. In "leapfrog": use "pressure_var"; deleted variables "p", "longcles". Converted common blocks "YOECUMF", "YOEGWD" to modules. Removed argument "pplay" in "cvltr", "diagetpq", "nflxtr". Created module "raddimlw" from include file "raddimlw.h". Corrected call to "new_unit" in "test_disvert".
New variables "*_dir" in "g95.mk". Corrected some bugs: "etat0_lim" works, but not "gcm".
This revision is not in working order. Pending some moving of files. Important changes. In the program "etat0_lim": ozone coefficients from Mobidic are regridded in time instead of pressure ; consequences in "etat0". In the program "gcm", ozone coefficients from Mobidic are read once per day only for the current day and regridded in pressure ; consequences in "o3_chem_m", "regr_pr_coefoz", "phytrac" and "regr_pr_comb_coefoz_m". NetCDF95 is a library and does not export NetCDF. New variables "nag_gl_options", "nag_fcalls_options" and "nag_cross_options" in "nag_tools.mk". "check_coefoz.jnl" rewritten entirely for new version of "coefoz_LMDZ.nc". Target "obj_etat0_lim" moved from "GNUmakefile" to "nag_rules.mk". Added some "intent" attributes in "calfis", "clmain", "clqh", "cltrac", "cltracrn", "cvltr", "ini_undefSTD", "moy_undefSTD", "nflxtr", "phystokenc", "phytrac", "readsulfate", "readsulfate_preind" and "undefSTD". In "dynetat0", "dynredem0" and "gcm", "phis" has rank 2 instead of 1. "phis" has assumed shape in "dynredem0". Added module containing "dynredem0". Changed some calls with NetCDF Fortran 77 interface to calls with NetCDF95 interface. Replaced calls to "ssum" by calls to "sum" in "inigeom". In "make.sh", new option "-c" to change compiler. In "aaam_bud", argument "rjour" deleted. In "physiq": renamed some variables; deleted variable "xjour". In "phytrac": renamed some variables; new argument "lmt_pas".
Created module from included file parafilt. Converted caldyn0 to free format. Added a rule to create cross-references with NAG. Added optional attribute in iniadvtrac. Suppressed argument nq in dynredem0 and dynredem1, using nqmx instead. Replaced some NetCDF calls by netcdf95 calls in dynredem0. Added intent attribute in dynredem0 and dynredem1. Annotated use statements with only clause, in dynredem1. Suppressed variable nq and argument of iniadvtrac in etat0. Added test on nqmx in etat0.
Initial import
This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.
ViewVC Help | |
Powered by ViewVC 1.1.21 |