Parent Directory
|
Revision Log
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.
1 | module tau2alpha_m |
2 | |
3 | IMPLICIT NONE |
4 | |
5 | contains |
6 | |
7 | SUBROUTINE tau2alpha(dxdy, rlat, taumin, taumax, alpha) |
8 | |
9 | use conf_guide_m, only: lat_min_guide, lat_max_guide, factt |
10 | use init_tau2alpha_m, only: dxdy_min, dxdy_max, gamma |
11 | USE nr_util, ONLY: pi, assert_eq |
12 | |
13 | REAL, intent(in):: dxdy(:, :) ! (n_lon, n_lat) |
14 | REAL, intent(in):: rlat(:) ! (n_lat) |
15 | REAL, intent(in):: taumin, taumax |
16 | real, intent(out):: alpha(:, :) ! (n_lon, n_lat) |
17 | |
18 | ! Local: |
19 | REAL alphamin, alphamax, xi |
20 | INTEGER i, j, n_lon, n_lat |
21 | REAL zlat |
22 | |
23 | !------------------------------------------------------------ |
24 | |
25 | PRINT *, 'Call sequence information: tau2alpha' |
26 | |
27 | n_lon = assert_eq(size(alpha, 1), size(dxdy, 1), "tau2alpha n_lon") |
28 | n_lat = assert_eq(size(alpha, 2), size(dxdy, 2), size(rlat), & |
29 | "tau2alpha n_lat") |
30 | |
31 | alphamin = factt / taumax |
32 | alphamax = factt / taumin |
33 | |
34 | DO j = 1, n_lat |
35 | zlat = rlat(j) * 180. / pi |
36 | IF (lat_min_guide <= zlat .AND. zlat <= lat_max_guide) THEN |
37 | DO i = 1, n_lon |
38 | xi = min(((dxdy_max - dxdy(i, j)) & |
39 | / (dxdy_max - dxdy_min))**gamma, 1.) |
40 | alpha(i, j) = xi * alphamin + (1. - xi) * alphamax |
41 | END DO |
42 | ELSE |
43 | alpha(:, j) = 0. |
44 | END IF |
45 | END DO |
46 | |
47 | END SUBROUTINE tau2alpha |
48 | |
49 | end module tau2alpha_m |
ViewVC Help | |
Powered by ViewVC 1.1.21 |