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 | guez | 37 | module tau2alpha_m |
2 | |||
3 | guez | 103 | IMPLICIT NONE |
4 | guez | 37 | |
5 | contains | ||
6 | |||
7 | guez | 115 | SUBROUTINE tau2alpha(dxdy, rlat, taumin, taumax, alpha) |
8 | guez | 37 | |
9 | guez | 115 | 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 | guez | 37 | |
13 | guez | 115 | 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 | guez | 103 | |
18 | ! Local: | ||
19 | REAL alphamin, alphamax, xi | ||
20 | guez | 115 | INTEGER i, j, n_lon, n_lat |
21 | guez | 37 | REAL zlat |
22 | |||
23 | guez | 44 | !------------------------------------------------------------ |
24 | |||
25 | guez | 115 | PRINT *, 'Call sequence information: tau2alpha' |
26 | guez | 109 | |
27 | guez | 115 | 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 | guez | 109 | |
31 | guez | 115 | alphamin = factt / taumax |
32 | alphamax = factt / taumin | ||
33 | guez | 113 | |
34 | guez | 115 | 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 | guez | 37 | END DO |
42 | ELSE | ||
43 | guez | 115 | alpha(:, j) = 0. |
44 | guez | 37 | END IF |
45 | END DO | ||
46 | |||
47 | END SUBROUTINE tau2alpha | ||
48 | |||
49 | end module tau2alpha_m |
ViewVC Help | |
Powered by ViewVC 1.1.21 |