Parent Directory | Revision Log
Sticky Revision: |
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.
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.
Removed unused arguments of groupe, cv3_undilute2, cv_undilute2, interfsur_lim, drag_noro, orodrag, gwprofil Chickened out of revision 148: back to double precision in invert_zoom_x (and overloaded rtsafe).
In invert_zoom_x, call rtsafe instead of the equivalent coding that was there. funcd needs to access a[0-4] and abs_y so we upgrade a[0-4] from arguments of coefpoly to variables of module coefpoly_m and abs_y from local variable of invert_zoom_x to private variable of module invert_zoom_x_m. Removed unused arguments t10m and q10m of hbtm.
Renamed variables in fxhyp and invert_zoom_x to be closer to external documentation. Changed from double precision to real in invert_zoom_x: I do not see the need for double precision and double precision is annoying because I want to use rtsafe without overloading it in Numer_Rec_95. Results are changed at the numerical noise level.
We use the fact that \tilde X is an odd function in invert_zoom_x so we only need arrays for the domain \tilde x \in [0, \pi].
Renamed bibio to misc. In procedure fxhyp, use the fact that xf is an odd function of xtild. In procedure invert_zoom_x, replace linear search in xf by bisection. Also, use result from previous loop iteration as initial guess. Variable "it" cannot be equal to 2 * nmax after search. Unused arguments: hm of cv3_feed; ph, qnk, tv,tvp of cv3_mixing; ppsol of lw; rconst, temp of vdif_kcay; rconst, plev, temp, ustar, l_mix of yamada.
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.
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.
Sources inside, compilation outside.
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.
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.
Extracted the case grossismx == 1 from procedure fxhyp_loop_ik up into procedure fxhyp. Since we have to do the test somewhere, better to do it up there. The logic gets much clearer. Also, a lot of computations are not needed in the case grossismx == 1. We could then remove arguments ik and decalx of fxhyp_loop_ik.
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_loop_ik, when testing whether xvrai is between -pi and pi, changed back the boundaries from -pi - 1d-5 to - pi_d - 0.1 and from pi + 1d-5 to pi_d + 0.1. Fixed the logic: for ik = 1, we rearrange longitudes between -pi and pi, if necessary. For other values of ik, we apply the same rearrangement. In module serre, change the default values of dzoomx and dzoomy to 0.2, because dzoomx must be > 0 when grossismx > 1. With this revision, we recover the results of revision 120 and we remove the bug that appeared with clon = 20.
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.
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 |