[1335] | 1 | ! |
---|
| 2 | ! phys_local_var_mod.F90 1327 2010-03-17 15:33:56Z idelkadi $ |
---|
| 3 | |
---|
[1938] | 4 | MODULE phys_output_var_mod |
---|
[1335] | 5 | |
---|
[2854] | 6 | USE dimphy |
---|
[1938] | 7 | ! Variables outputs pour les ecritures des sorties |
---|
| 8 | !====================================================================== |
---|
| 9 | ! |
---|
| 10 | ! |
---|
| 11 | !====================================================================== |
---|
| 12 | ! Declaration des variables |
---|
[1335] | 13 | |
---|
[1938] | 14 | REAL, SAVE, ALLOCATABLE :: snow_o(:), zfra_o(:) |
---|
| 15 | !$OMP THREADPRIVATE(snow_o, zfra_o) |
---|
| 16 | INTEGER, SAVE, ALLOCATABLE :: itau_con(:) ! Nombre de pas ou rflag <= 1 |
---|
| 17 | !$OMP THREADPRIVATE(itau_con) |
---|
[2585] | 18 | REAL, SAVE, ALLOCATABLE :: bils_ec(:) ! Contribution of energy conservation |
---|
| 19 | REAL, SAVE, ALLOCATABLE :: bils_ech(:) ! Contribution of energy conservation |
---|
| 20 | REAL, SAVE, ALLOCATABLE :: bils_tke(:) ! Contribution of energy conservation |
---|
| 21 | REAL, SAVE, ALLOCATABLE :: bils_diss(:) ! Contribution of energy conservation |
---|
| 22 | REAL, SAVE, ALLOCATABLE :: bils_kinetic(:) ! bilan de chaleur au sol, kinetic |
---|
| 23 | REAL, SAVE, ALLOCATABLE :: bils_enthalp(:) ! bilan de chaleur au sol |
---|
| 24 | REAL, SAVE, ALLOCATABLE :: bils_latent(:) ! bilan de chaleur au sol |
---|
[2042] | 25 | !$OMP THREADPRIVATE(bils_ec,bils_ech,bils_tke,bils_diss,bils_kinetic,bils_enthalp,bils_latent) |
---|
[2799] | 26 | ! output variables for energy conservation tests, computed in add_phys_tend |
---|
| 27 | REAL, SAVE, ALLOCATABLE :: d_qw_col(:) ! watter vapour mass budget for each column (kg/m2/s) |
---|
| 28 | REAL, SAVE, ALLOCATABLE :: d_ql_col(:) ! liquid watter mass budget for each column (kg/m2/s) |
---|
| 29 | REAL, SAVE, ALLOCATABLE :: d_qs_col(:) ! solid watter mass budget for each column (kg/m2/s) |
---|
| 30 | REAL, SAVE, ALLOCATABLE :: d_qt_col(:) ! total watter mass budget for each column (kg/m2/s) |
---|
| 31 | REAL, SAVE, ALLOCATABLE :: d_ek_col(:) ! kinetic energy budget for each column (W/m2) |
---|
| 32 | REAL, SAVE, ALLOCATABLE :: d_h_dair_col(:) ! enthalpy budget of dry air for each column (W/m2) |
---|
| 33 | REAL, SAVE, ALLOCATABLE :: d_h_qw_col(:) ! enthalpy budget of watter vapour for each column (W/m2) |
---|
| 34 | REAL, SAVE, ALLOCATABLE :: d_h_ql_col(:) ! enthalpy budget of liquid watter for each column (W/m2) |
---|
| 35 | REAL, SAVE, ALLOCATABLE :: d_h_qs_col(:) ! enthalpy budget of solid watter for each column (W/m2) |
---|
| 36 | REAL, SAVE, ALLOCATABLE :: d_h_col(:) ! total enthalpy budget for each column (W/m2) |
---|
| 37 | !$OMP THREADPRIVATE(d_qw_col, d_ql_col, d_qs_col, d_qt_col, d_ek_col, d_h_dair_col) |
---|
[2804] | 38 | !$OMP THREADPRIVATE(d_h_qw_col, d_h_ql_col, d_h_qs_col, d_h_col) |
---|
[1753] | 39 | |
---|
[2580] | 40 | ! Marine |
---|
| 41 | ! Variables de sortie du simulateur AIRS |
---|
[1865] | 42 | |
---|
[2585] | 43 | REAL, SAVE, ALLOCATABLE :: map_prop_hc(:),map_prop_hist(:),alt_tropo(:) |
---|
| 44 | !$OMP THREADPRIVATE(map_prop_hc,map_prop_hist,alt_tropo) |
---|
| 45 | REAL, SAVE, ALLOCATABLE :: map_emis_hc(:),map_iwp_hc(:),map_deltaz_hc(:), & |
---|
| 46 | map_pcld_hc(:),map_tcld_hc(:) |
---|
| 47 | !$OMP THREADPRIVATE(map_emis_hc,map_iwp_hc,map_deltaz_hc,map_pcld_hc,map_tcld_hc) |
---|
| 48 | REAL, SAVE, ALLOCATABLE :: map_emis_hist(:),map_iwp_hist(:),map_deltaz_hist(:),map_rad_hist(:) |
---|
| 49 | !$OMP THREADPRIVATE(map_emis_hist,map_iwp_hist,map_deltaz_hist,map_rad_hist) |
---|
| 50 | REAL, SAVE, ALLOCATABLE :: map_ntot(:),map_hc(:),map_hist(:) |
---|
| 51 | REAL, SAVE, ALLOCATABLE :: map_Cb(:),map_ThCi(:),map_Anv(:) |
---|
| 52 | !$OMP THREADPRIVATE(map_ntot,map_hc,map_hist,map_Cb,map_ThCi,map_Anv) |
---|
| 53 | REAL, SAVE, ALLOCATABLE :: map_emis_Cb(:),map_pcld_Cb(:),map_tcld_Cb(:) |
---|
| 54 | REAL, SAVE, ALLOCATABLE :: map_emis_ThCi(:),map_pcld_ThCi(:),map_tcld_ThCi(:) |
---|
| 55 | !$OMP THREADPRIVATE(map_emis_Cb,map_pcld_Cb,map_tcld_Cb,map_emis_ThCi) |
---|
| 56 | REAL, SAVE, ALLOCATABLE :: map_emis_Anv(:),map_pcld_Anv(:),map_tcld_Anv(:) |
---|
| 57 | !$OMP THREADPRIVATE(map_pcld_ThCi,map_tcld_ThCi,map_emis_Anv,map_pcld_Anv,map_tcld_Anv) |
---|
| 58 | |
---|
[2580] | 59 | |
---|
[1938] | 60 | ! ug Plein de variables venues de phys_output_mod |
---|
[2752] | 61 | INTEGER, PARAMETER :: nfiles = 10 |
---|
[1938] | 62 | LOGICAL, DIMENSION(nfiles), SAVE :: clef_files |
---|
| 63 | LOGICAL, DIMENSION(nfiles), SAVE :: clef_stations |
---|
| 64 | INTEGER, DIMENSION(nfiles), SAVE :: lev_files |
---|
| 65 | INTEGER, DIMENSION(nfiles), SAVE :: nid_files |
---|
| 66 | INTEGER, DIMENSION(nfiles), SAVE :: nnid_files |
---|
| 67 | !$OMP THREADPRIVATE(clef_files, clef_stations, lev_files,nid_files,nnid_files) |
---|
| 68 | INTEGER, DIMENSION(nfiles), SAVE :: nnhorim |
---|
[1761] | 69 | |
---|
[1938] | 70 | INTEGER, DIMENSION(nfiles), SAVE :: nhorim, nvertm |
---|
| 71 | INTEGER, DIMENSION(nfiles), SAVE :: nvertap, nvertbp, nvertAlt |
---|
| 72 | REAL, DIMENSION(nfiles), SAVE :: zoutm |
---|
| 73 | CHARACTER(LEN=20), DIMENSION(nfiles), SAVE :: type_ecri |
---|
| 74 | !$OMP THREADPRIVATE(nnhorim, nhorim, nvertm, zoutm,type_ecri) |
---|
| 75 | CHARACTER(LEN=20), DIMENSION(nfiles), SAVE :: type_ecri_files, phys_out_filetypes |
---|
| 76 | !$OMP THREADPRIVATE(type_ecri_files, phys_out_filetypes) |
---|
| 77 | CHARACTER(LEN=20), DIMENSION(nfiles), SAVE :: phys_out_filenames |
---|
| 78 | !$OMP THREADPRIVATE(phys_out_filenames) |
---|
[1791] | 79 | |
---|
[1938] | 80 | ! swaero_diag : flag indicates if it is necessary to do calculation for some aerosol diagnostics |
---|
[2854] | 81 | ! dryaod_diag : flag indicates if it is necessary to do calculation for some aerosol diagnostics |
---|
[2529] | 82 | !--OB: this needs to be set to TRUE by default and changed back to FALSE after first radiation call |
---|
| 83 | !-- and corrected back to TRUE based on output requests |
---|
| 84 | LOGICAL, SAVE :: swaero_diag=.TRUE. |
---|
[2854] | 85 | LOGICAL, SAVE :: dryaod_diag=.TRUE. |
---|
| 86 | !$OMP THREADPRIVATE(swaero_diag, dryaod_diag) |
---|
[1791] | 87 | |
---|
[1938] | 88 | INTEGER, SAVE:: levmin(nfiles) = 1 |
---|
| 89 | INTEGER, SAVE:: levmax(nfiles) |
---|
| 90 | !$OMP THREADPRIVATE(levmin, levmax) |
---|
[1791] | 91 | |
---|
[1938] | 92 | REAL, SAVE :: zdtime_moy |
---|
| 93 | !$OMP THREADPRIVATE(zdtime_moy) |
---|
[1797] | 94 | |
---|
[1938] | 95 | LOGICAL, SAVE :: vars_defined = .FALSE. ! ug PAS THREADPRIVATE ET C'EST NORMAL |
---|
[1807] | 96 | |
---|
[2333] | 97 | REAL, allocatable:: zustr_gwd_hines(:), zvstr_gwd_hines(:) ! (klon) |
---|
| 98 | REAL, allocatable:: zustr_gwd_front(:), zvstr_gwd_front(:) ! (klon) |
---|
[1938] | 99 | REAL, allocatable:: zustr_gwd_rando(:), zvstr_gwd_rando(:) ! (klon) |
---|
[2341] | 100 | !$OMP THREADPRIVATE(zustr_gwd_hines, zvstr_gwd_hines) |
---|
| 101 | !$OMP THREADPRIVATE(zustr_gwd_front, zvstr_gwd_front) |
---|
[1938] | 102 | !$OMP THREADPRIVATE(zustr_gwd_rando, zvstr_gwd_rando) |
---|
| 103 | |
---|
[1791] | 104 | TYPE ctrl_out |
---|
| 105 | INTEGER,DIMENSION(nfiles) :: flag |
---|
| 106 | CHARACTER(len=20) :: name |
---|
| 107 | CHARACTER(len=150) :: description |
---|
| 108 | CHARACTER(len=20) :: unit |
---|
| 109 | CHARACTER(len=20),DIMENSION(nfiles) :: type_ecrit |
---|
| 110 | END TYPE ctrl_out |
---|
[1938] | 111 | |
---|
[2538] | 112 | REAL, SAVE, ALLOCATABLE :: sens_prec_liq_o(:,:), sens_prec_sol_o(:,:) |
---|
| 113 | REAL, SAVE, ALLOCATABLE :: lat_prec_liq_o(:,:), lat_prec_sol_o(:,:) |
---|
| 114 | !$OMP THREADPRIVATE(sens_prec_liq_o, sens_prec_sol_o,lat_prec_liq_o,lat_prec_sol_o) |
---|
| 115 | |
---|
[1335] | 116 | CONTAINS |
---|
| 117 | |
---|
[1938] | 118 | !====================================================================== |
---|
| 119 | SUBROUTINE phys_output_var_init |
---|
| 120 | use dimphy |
---|
[1335] | 121 | |
---|
[1938] | 122 | IMPLICIT NONE |
---|
[1335] | 123 | |
---|
[1938] | 124 | include "clesphys.h" |
---|
[1335] | 125 | |
---|
[1938] | 126 | !------------------------------------------------ |
---|
[1335] | 127 | |
---|
[1938] | 128 | allocate(snow_o(klon), zfra_o(klon)) |
---|
| 129 | allocate(itau_con(klon)) |
---|
[2538] | 130 | allocate(sens_prec_liq_o(klon,2)) |
---|
| 131 | allocate(sens_prec_sol_o(klon,2)) |
---|
| 132 | allocate(lat_prec_liq_o(klon,2)) |
---|
| 133 | allocate(lat_prec_sol_o(klon,2)) |
---|
| 134 | sens_prec_liq_o = 0.0 ; sens_prec_sol_o = 0.0 |
---|
| 135 | lat_prec_liq_o = 0.0 ; lat_prec_sol_o = 0.0 |
---|
| 136 | |
---|
[2042] | 137 | allocate (bils_ec(klon),bils_ech(klon),bils_tke(klon),bils_diss(klon),bils_kinetic(klon),bils_enthalp(klon),bils_latent(klon)) |
---|
[2799] | 138 | allocate (d_qw_col(klon), d_ql_col(klon), d_qs_col(klon), d_qt_col(klon), d_ek_col(klon), d_h_dair_col(klon) & |
---|
| 139 | & , d_h_qw_col(klon), d_h_ql_col(klon), d_h_qs_col(klon), d_h_col(klon)) |
---|
| 140 | d_qw_col=0. ; d_ql_col=0. ; d_qs_col=0. ; d_qt_col=0. ; d_ek_col=0. ; d_h_dair_col =0. |
---|
| 141 | d_h_qw_col=0. ; d_h_ql_col=0. ; d_h_qs_col=0. ; d_h_col=0. |
---|
[1335] | 142 | |
---|
[2580] | 143 | ! Marine |
---|
| 144 | ! Variables de sortie simulateur AIRS |
---|
| 145 | |
---|
[2585] | 146 | ! if (ok_airs) then |
---|
[2580] | 147 | allocate (map_prop_hc(klon),map_prop_hist(klon)) |
---|
| 148 | allocate (alt_tropo(klon)) |
---|
[2582] | 149 | allocate (map_emis_hc(klon),map_iwp_hc(klon),map_deltaz_hc(klon)) |
---|
[2580] | 150 | allocate (map_pcld_hc(klon),map_tcld_hc(klon)) |
---|
| 151 | allocate (map_emis_hist(klon),map_iwp_hist(klon),map_deltaz_hist(klon)) |
---|
| 152 | allocate (map_rad_hist(klon)) |
---|
| 153 | allocate (map_ntot(klon),map_hc(klon),map_hist(klon)) |
---|
| 154 | allocate (map_Cb(klon),map_ThCi(klon),map_Anv(klon)) |
---|
| 155 | allocate (map_emis_Cb(klon),map_pcld_Cb(klon),map_tcld_Cb(klon)) |
---|
| 156 | allocate (map_emis_ThCi(klon),map_pcld_ThCi(klon),map_tcld_ThCi(klon)) |
---|
| 157 | allocate (map_emis_Anv(klon),map_pcld_Anv(klon),map_tcld_Anv(klon)) |
---|
[2585] | 158 | ! endif |
---|
[2580] | 159 | |
---|
[2333] | 160 | IF (ok_hines) allocate(zustr_gwd_hines(klon), zvstr_gwd_hines(klon)) |
---|
| 161 | IF (.not.ok_hines.and.ok_gwd_rando) & |
---|
| 162 | allocate(zustr_gwd_front(klon), zvstr_gwd_front(klon)) |
---|
[1938] | 163 | IF (ok_gwd_rando) allocate(zustr_gwd_rando(klon), zvstr_gwd_rando(klon)) |
---|
[1335] | 164 | |
---|
[1938] | 165 | END SUBROUTINE phys_output_var_init |
---|
[1335] | 166 | |
---|
[1938] | 167 | !====================================================================== |
---|
| 168 | SUBROUTINE phys_output_var_end |
---|
[2854] | 169 | USE dimphy |
---|
[1938] | 170 | IMPLICIT NONE |
---|
| 171 | |
---|
[2582] | 172 | include "clesphys.h" |
---|
| 173 | |
---|
[1938] | 174 | deallocate(snow_o,zfra_o,itau_con) |
---|
[2042] | 175 | deallocate (bils_ec,bils_ech,bils_tke,bils_diss,bils_kinetic,bils_enthalp,bils_latent) |
---|
[2799] | 176 | deallocate (d_qw_col, d_ql_col, d_qs_col, d_qt_col, d_ek_col, d_h_dair_col & |
---|
| 177 | & , d_h_qw_col, d_h_ql_col, d_h_qs_col, d_h_col) |
---|
[1938] | 178 | |
---|
[2580] | 179 | ! Marine |
---|
| 180 | ! Variables de sortie simulateur AIRS |
---|
| 181 | |
---|
[2585] | 182 | ! if (ok_airs) then |
---|
[2580] | 183 | deallocate (map_prop_hc,map_prop_hist) |
---|
| 184 | deallocate (alt_tropo) |
---|
[2582] | 185 | deallocate (map_emis_hc,map_iwp_hc,map_deltaz_hc) |
---|
[2580] | 186 | deallocate (map_pcld_hc,map_tcld_hc) |
---|
| 187 | deallocate (map_emis_hist,map_iwp_hist,map_deltaz_hist) |
---|
| 188 | deallocate (map_rad_hist) |
---|
| 189 | deallocate (map_ntot,map_hc,map_hist) |
---|
| 190 | deallocate (map_Cb,map_ThCi,map_Anv) |
---|
| 191 | deallocate (map_emis_Cb,map_pcld_Cb,map_tcld_Cb) |
---|
| 192 | deallocate (map_emis_ThCi,map_pcld_ThCi,map_tcld_ThCi) |
---|
| 193 | deallocate (map_emis_Anv,map_pcld_Anv,map_tcld_Anv) |
---|
[2585] | 194 | ! endif |
---|
[2580] | 195 | |
---|
[1938] | 196 | END SUBROUTINE phys_output_var_end |
---|
| 197 | |
---|
[1335] | 198 | END MODULE phys_output_var_mod |
---|