Parent Directory | Revision Log
Sticky Revision: |
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.
Eignvectors computed by procedure jacobi are already normalized. No need to call acc.
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.
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.
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.
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.
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).
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 |