[3540] | 1 | ! |
---|
| 2 | ! $Id: phyaqua_mod.f90 5285 2024-10-28 13:33:29Z abarral $ |
---|
| 3 | ! |
---|
[1992] | 4 | MODULE phyaqua_mod |
---|
| 5 | ! Routines complementaires pour la physique planetaire. |
---|
[5282] | 6 | USE clesphys_mod_h |
---|
| 7 | IMPLICIT NONE |
---|
[1529] | 8 | |
---|
[1992] | 9 | CONTAINS |
---|
[1529] | 10 | |
---|
[3579] | 11 | SUBROUTINE iniaqua(nlon,year_len,iflag_phys) |
---|
[1529] | 12 | |
---|
[1992] | 13 | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
| 14 | ! Creation d'un etat initial et de conditions aux limites |
---|
| 15 | ! (resp startphy.nc et limit.nc) pour des configurations idealisees |
---|
| 16 | ! du modele LMDZ dans sa version terrestre. |
---|
| 17 | ! iflag_phys est un parametre qui controle |
---|
| 18 | ! iflag_phys = N |
---|
| 19 | ! de 100 a 199 : aqua planetes avec SST forcees |
---|
| 20 | ! N-100 determine le type de SSTs |
---|
| 21 | ! de 200 a 299 : terra planetes avec Ts calcule |
---|
[1529] | 22 | |
---|
[1992] | 23 | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
[1529] | 24 | |
---|
[1992] | 25 | USE dimphy, ONLY: klon |
---|
[2351] | 26 | USE geometry_mod, ONLY : latitude |
---|
[1992] | 27 | USE surface_data, ONLY: type_ocean, ok_veget |
---|
| 28 | USE pbl_surface_mod, ONLY: pbl_surface_init |
---|
| 29 | USE fonte_neige_mod, ONLY: fonte_neige_init |
---|
| 30 | USE phys_state_var_mod |
---|
[2344] | 31 | USE time_phylmdz_mod, ONLY: day_ref, ndays, pdtphys, & |
---|
| 32 | day_ini,day_end |
---|
[1992] | 33 | USE indice_sol_mod |
---|
[2344] | 34 | USE nrtype, ONLY: pi |
---|
[3435] | 35 | ! USE ioipsl |
---|
| 36 | USE mod_phys_lmdz_para, ONLY: is_master |
---|
| 37 | USE mod_phys_lmdz_transfert_para, ONLY: bcast |
---|
| 38 | USE mod_grid_phy_lmdz |
---|
| 39 | USE ioipsl_getin_p_mod, ONLY : getin_p |
---|
[5273] | 40 | USE phys_cal_mod , ONLY: calend, year_len_phy => year_len |
---|
| 41 | USE dimsoil_mod_h, ONLY: nsoilmx |
---|
[5285] | 42 | USE yomcst_mod_h |
---|
[5274] | 43 | IMPLICIT NONE |
---|
[1529] | 44 | |
---|
[5274] | 45 | |
---|
[1671] | 46 | |
---|
[3579] | 47 | INTEGER, INTENT (IN) :: nlon, year_len, iflag_phys |
---|
[1992] | 48 | ! IM ajout latfi, lonfi |
---|
[2351] | 49 | ! REAL, INTENT (IN) :: lonfi(nlon), latfi(nlon) |
---|
[1529] | 50 | |
---|
[1992] | 51 | INTEGER type_profil, type_aqua |
---|
[1529] | 52 | |
---|
[1992] | 53 | ! Ajouts initialisation des surfaces |
---|
| 54 | REAL :: run_off_lic_0(nlon) |
---|
| 55 | REAL :: qsolsrf(nlon, nbsrf), snsrf(nlon, nbsrf) |
---|
| 56 | REAL :: tsoil(nlon, nsoilmx, nbsrf) |
---|
| 57 | REAL :: tslab(nlon), seaice(nlon) |
---|
[2243] | 58 | REAL fder(nlon) |
---|
[1529] | 59 | |
---|
| 60 | |
---|
| 61 | |
---|
[1992] | 62 | ! Arguments : |
---|
| 63 | ! ----------- |
---|
[1529] | 64 | |
---|
[1992] | 65 | ! integer radpas |
---|
| 66 | INTEGER it, unit, i, k, itap |
---|
[1529] | 67 | |
---|
[1992] | 68 | REAL rugos, albedo |
---|
| 69 | REAL tsurf |
---|
| 70 | REAL time, timestep, day, day0 |
---|
[2243] | 71 | REAL qsol_f |
---|
[1992] | 72 | REAL rugsrel(nlon) |
---|
| 73 | LOGICAL alb_ocean |
---|
[1529] | 74 | |
---|
[1992] | 75 | CHARACTER *80 ans, file_forctl, file_fordat, file_start |
---|
| 76 | CHARACTER *100 file, var |
---|
| 77 | CHARACTER *2 cnbl |
---|
[1529] | 78 | |
---|
[3540] | 79 | REAL phy_nat(nlon, year_len) |
---|
| 80 | REAL phy_alb(nlon, year_len) |
---|
| 81 | REAL phy_sst(nlon, year_len) |
---|
| 82 | REAL phy_bil(nlon, year_len) |
---|
| 83 | REAL phy_rug(nlon, year_len) |
---|
| 84 | REAL phy_ice(nlon, year_len) |
---|
| 85 | REAL phy_fter(nlon, year_len) |
---|
| 86 | REAL phy_foce(nlon, year_len) |
---|
| 87 | REAL phy_fsic(nlon, year_len) |
---|
| 88 | REAL phy_flic(nlon, year_len) |
---|
[1529] | 89 | |
---|
[1992] | 90 | INTEGER, SAVE :: read_climoz = 0 ! read ozone climatology |
---|
[3435] | 91 | !$OMP THREADPRIVATE(read_climoz) |
---|
[1529] | 92 | |
---|
[1992] | 93 | ! ------------------------------------------------------------------------- |
---|
| 94 | ! declaration pour l'appel a phyredem |
---|
| 95 | ! ------------------------------------------------------------------------- |
---|
[1529] | 96 | |
---|
[1992] | 97 | ! real pctsrf(nlon,nbsrf),ftsol(nlon,nbsrf) |
---|
| 98 | REAL falbe(nlon, nbsrf), falblw(nlon, nbsrf) |
---|
| 99 | ! real pbl_tke(nlon,llm,nbsrf) |
---|
| 100 | ! real rain_fall(nlon),snow_fall(nlon) |
---|
| 101 | ! real solsw(nlon), sollw(nlon),radsol(nlon) |
---|
| 102 | ! real t_ancien(nlon,llm),q_ancien(nlon,llm),rnebcon(nlon,llm) |
---|
| 103 | ! real ratqs(nlon,llm) |
---|
| 104 | ! real clwcon(nlon,llm) |
---|
[1529] | 105 | |
---|
[1992] | 106 | INTEGER longcles |
---|
| 107 | PARAMETER (longcles=20) |
---|
| 108 | REAL clesphy0(longcles) |
---|
[1529] | 109 | |
---|
| 110 | |
---|
[1992] | 111 | ! ----------------------------------------------------------------------- |
---|
| 112 | ! dynamial tendencies : |
---|
| 113 | ! --------------------- |
---|
[1529] | 114 | |
---|
[1992] | 115 | INTEGER l, ierr, aslun |
---|
[1529] | 116 | |
---|
[1992] | 117 | REAL paire |
---|
[1529] | 118 | |
---|
[3531] | 119 | ! Local |
---|
| 120 | CHARACTER (LEN=20) :: modname='phyaqua' |
---|
| 121 | CHARACTER (LEN=80) :: abort_message |
---|
[1529] | 122 | |
---|
[3531] | 123 | |
---|
[1992] | 124 | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
| 125 | ! INITIALISATIONS |
---|
| 126 | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
[1529] | 127 | |
---|
[1992] | 128 | ! ----------------------------------------------------------------------- |
---|
| 129 | ! Initialisations des constantes |
---|
| 130 | ! ------------------------------- |
---|
[1529] | 131 | |
---|
[3579] | 132 | !IF (calend .EQ. "earth_360d") Then |
---|
| 133 | year_len_phy = year_len |
---|
| 134 | !END IF |
---|
| 135 | |
---|
[5084] | 136 | if (year_len.ne.360) then |
---|
[3579] | 137 | write (*,*) year_len |
---|
[4463] | 138 | call abort_physic("iniaqua", 'iniaqua: 360 day calendar is required !', 1) |
---|
[3540] | 139 | endif |
---|
| 140 | |
---|
[1992] | 141 | type_aqua = iflag_phys/100 |
---|
| 142 | type_profil = iflag_phys - type_aqua*100 |
---|
| 143 | PRINT *, 'iniaqua:type_aqua, type_profil', type_aqua, type_profil |
---|
[1529] | 144 | |
---|
[1992] | 145 | IF (klon/=nlon) THEN |
---|
| 146 | WRITE (*, *) 'iniaqua: klon=', klon, ' nlon=', nlon |
---|
[3531] | 147 | abort_message= 'probleme de dimensions dans iniaqua' |
---|
| 148 | CALL abort_physic(modname,abort_message,1) |
---|
[1992] | 149 | END IF |
---|
| 150 | CALL phys_state_var_init(read_climoz) |
---|
[1529] | 151 | |
---|
| 152 | |
---|
[1992] | 153 | read_climoz = 0 |
---|
| 154 | day0 = 217. |
---|
| 155 | day = day0 |
---|
| 156 | it = 0 |
---|
| 157 | time = 0. |
---|
[1529] | 158 | |
---|
[1992] | 159 | ! ----------------------------------------------------------------------- |
---|
| 160 | ! initialisations de la physique |
---|
| 161 | ! ----------------------------------------------------------------------- |
---|
[1529] | 162 | |
---|
[2344] | 163 | day_ini = day_ref |
---|
| 164 | day_end = day_ini + ndays |
---|
[1759] | 165 | |
---|
[3435] | 166 | nbapp_rad = 24 |
---|
| 167 | CALL getin_p('nbapp_rad', nbapp_rad) |
---|
| 168 | |
---|
[1992] | 169 | ! --------------------------------------------------------------------- |
---|
| 170 | ! Creation des conditions aux limites: |
---|
| 171 | ! ------------------------------------ |
---|
| 172 | ! Initialisations des constantes |
---|
| 173 | ! Ajouter les manquants dans planete.def... (albedo etc) |
---|
[3435] | 174 | co2_ppm = 348. |
---|
| 175 | CALL getin_p('co2_ppm', co2_ppm) |
---|
| 176 | |
---|
| 177 | solaire = 1365. |
---|
| 178 | CALL getin_p('solaire', solaire) |
---|
| 179 | |
---|
[1992] | 180 | ! CALL getin('albedo',albedo) ! albedo is set below, depending on |
---|
| 181 | ! type_aqua |
---|
[3435] | 182 | alb_ocean = .TRUE. |
---|
| 183 | CALL getin_p('alb_ocean', alb_ocean) |
---|
| 184 | |
---|
[1992] | 185 | WRITE (*, *) 'iniaqua: co2_ppm=', co2_ppm |
---|
| 186 | WRITE (*, *) 'iniaqua: solaire=', solaire |
---|
| 187 | WRITE (*, *) 'iniaqua: alb_ocean=', alb_ocean |
---|
[1529] | 188 | |
---|
[1992] | 189 | radsol = 0. |
---|
| 190 | qsol_f = 10. |
---|
[1529] | 191 | |
---|
[1992] | 192 | ! Conditions aux limites: |
---|
| 193 | ! ----------------------- |
---|
[1529] | 194 | |
---|
[1992] | 195 | qsol(:) = qsol_f |
---|
| 196 | rugsrel = 0.0 ! (rugsrel = rugoro) |
---|
| 197 | rugoro = 0.0 |
---|
| 198 | u_ancien = 0.0 |
---|
| 199 | v_ancien = 0.0 |
---|
| 200 | agesno = 50.0 |
---|
| 201 | ! Relief plat |
---|
| 202 | zmea = 0. |
---|
| 203 | zstd = 0. |
---|
| 204 | zsig = 0. |
---|
| 205 | zgam = 0. |
---|
| 206 | zthe = 0. |
---|
| 207 | zpic = 0. |
---|
| 208 | zval = 0. |
---|
[1529] | 209 | |
---|
[1992] | 210 | ! Une seule surface |
---|
| 211 | pctsrf = 0. |
---|
| 212 | IF (type_aqua==1) THEN |
---|
| 213 | rugos = 1.E-4 |
---|
| 214 | albedo = 0.19 |
---|
| 215 | pctsrf(:, is_oce) = 1. |
---|
| 216 | ELSE IF (type_aqua==2) THEN |
---|
| 217 | rugos = 0.03 |
---|
| 218 | albedo = 0.1 |
---|
| 219 | pctsrf(:, is_ter) = 1. |
---|
| 220 | END IF |
---|
[1529] | 221 | |
---|
[3435] | 222 | CALL getin_p('rugos', rugos) |
---|
| 223 | |
---|
[1992] | 224 | WRITE (*, *) 'iniaqua: rugos=', rugos |
---|
[2209] | 225 | zmasq(:) = pctsrf(:, is_ter) |
---|
[1529] | 226 | |
---|
[1992] | 227 | ! pctsrf_pot(:,is_oce) = 1. - zmasq(:) |
---|
| 228 | ! pctsrf_pot(:,is_sic) = 1. - zmasq(:) |
---|
[1529] | 229 | |
---|
[1992] | 230 | ! Si alb_ocean on calcule un albedo oceanique moyen |
---|
| 231 | ! if (alb_ocean) then |
---|
| 232 | ! Voir pourquoi on avait ca. |
---|
| 233 | ! CALL ini_alb_oce(phy_alb) |
---|
| 234 | ! else |
---|
| 235 | phy_alb(:, :) = albedo ! albedo land only (old value condsurf_jyg=0.3) |
---|
| 236 | ! endif !alb_ocean |
---|
[1529] | 237 | |
---|
[3540] | 238 | DO i = 1, year_len |
---|
[1992] | 239 | ! IM Terraplanete phy_sst(:,i) = 260.+50.*cos(rlatd(:))**2 |
---|
| 240 | ! IM ajout calcul profil sst selon le cas considere (cf. FBr) |
---|
[1529] | 241 | |
---|
[1992] | 242 | phy_nat(:, i) = 1.0 ! 0=ocean libre, 1=land, 2=glacier, 3=banquise |
---|
| 243 | phy_bil(:, i) = 1.0 ! ne sert que pour les slab_ocean |
---|
| 244 | phy_rug(:, i) = rugos ! longueur rugosite utilisee sur land only |
---|
| 245 | phy_ice(:, i) = 0.0 ! fraction de glace (?) |
---|
| 246 | phy_fter(:, i) = pctsrf(:, is_ter) ! fraction de glace (?) |
---|
| 247 | phy_foce(:, i) = pctsrf(:, is_oce) ! fraction de glace (?) |
---|
| 248 | phy_fsic(:, i) = pctsrf(:, is_sic) ! fraction de glace (?) |
---|
| 249 | phy_flic(:, i) = pctsrf(:, is_lic) ! fraction de glace (?) |
---|
| 250 | END DO |
---|
| 251 | ! IM calcul profil sst |
---|
[2351] | 252 | CALL profil_sst(nlon, latitude, type_profil, phy_sst) |
---|
[1529] | 253 | |
---|
[3435] | 254 | IF (grid_type==unstructured) THEN |
---|
| 255 | CALL writelim_unstruct(klon, phy_nat, phy_alb, phy_sst, phy_bil, phy_rug, phy_ice, & |
---|
| 256 | phy_fter, phy_foce, phy_flic, phy_fsic) |
---|
| 257 | ELSE |
---|
| 258 | |
---|
| 259 | CALL writelim(klon, phy_nat, phy_alb, phy_sst, phy_bil, phy_rug, phy_ice, & |
---|
| 260 | phy_fter, phy_foce, phy_flic, phy_fsic) |
---|
| 261 | ENDIF |
---|
[1529] | 262 | |
---|
[1992] | 263 | ! --------------------------------------------------------------------- |
---|
| 264 | ! Ecriture de l'etat initial: |
---|
| 265 | ! --------------------------- |
---|
[1529] | 266 | |
---|
| 267 | |
---|
[1992] | 268 | ! Ecriture etat initial physique |
---|
[1529] | 269 | |
---|
[2344] | 270 | timestep = pdtphys |
---|
| 271 | radpas = nint(rday/timestep/float(nbapp_rad)) |
---|
[1529] | 272 | |
---|
[1992] | 273 | DO i = 1, longcles |
---|
| 274 | clesphy0(i) = 0. |
---|
| 275 | END DO |
---|
| 276 | clesphy0(1) = float(iflag_con) |
---|
| 277 | clesphy0(2) = float(nbapp_rad) |
---|
| 278 | ! IF( cycle_diurne ) clesphy0(3) = 1. |
---|
| 279 | clesphy0(3) = 1. ! cycle_diurne |
---|
| 280 | clesphy0(4) = 1. ! soil_model |
---|
| 281 | clesphy0(5) = 1. ! new_oliq |
---|
| 282 | clesphy0(6) = 0. ! ok_orodr |
---|
| 283 | clesphy0(7) = 0. ! ok_orolf |
---|
| 284 | clesphy0(8) = 0. ! ok_limitvrai |
---|
[1529] | 285 | |
---|
| 286 | |
---|
[1992] | 287 | ! ======================================================================= |
---|
| 288 | ! Profils initiaux |
---|
| 289 | ! ======================================================================= |
---|
[1529] | 290 | |
---|
[1992] | 291 | ! On initialise les temperatures de surfaces comme les sst |
---|
| 292 | DO i = 1, nlon |
---|
| 293 | ftsol(i, :) = phy_sst(i, 1) |
---|
| 294 | tsoil(i, :, :) = phy_sst(i, 1) |
---|
| 295 | tslab(i) = phy_sst(i, 1) |
---|
| 296 | END DO |
---|
[1529] | 297 | |
---|
[1992] | 298 | falbe(:, :) = albedo |
---|
| 299 | falblw(:, :) = albedo |
---|
| 300 | rain_fall(:) = 0. |
---|
| 301 | snow_fall(:) = 0. |
---|
| 302 | solsw(:) = 0. |
---|
| 303 | sollw(:) = 0. |
---|
| 304 | radsol(:) = 0. |
---|
[1529] | 305 | |
---|
[1992] | 306 | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
| 307 | ! intialisation bidon mais pas grave |
---|
| 308 | t_ancien(:, :) = 0. |
---|
| 309 | q_ancien(:, :) = 0. |
---|
| 310 | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
| 311 | rnebcon = 0. |
---|
| 312 | ratqs = 0. |
---|
| 313 | clwcon = 0. |
---|
| 314 | pbl_tke = 1.E-8 |
---|
[1529] | 315 | |
---|
[1992] | 316 | ! variables supplementaires pour appel a plb_surface_init |
---|
| 317 | fder(:) = 0. |
---|
| 318 | seaice(:) = 0. |
---|
| 319 | run_off_lic_0 = 0. |
---|
[2243] | 320 | fevap = 0. |
---|
[1529] | 321 | |
---|
| 322 | |
---|
[1992] | 323 | ! Initialisations necessaires avant phyredem |
---|
| 324 | type_ocean = 'force' |
---|
| 325 | CALL fonte_neige_init(run_off_lic_0) |
---|
| 326 | qsolsrf(:, :) = qsol(1) ! humidite du sol des sous surface |
---|
| 327 | snsrf(:, :) = 0. ! couverture de neige des sous surface |
---|
[2243] | 328 | z0m(:, :) = rugos ! couverture de neige des sous surface |
---|
| 329 | z0h=z0m |
---|
[1530] | 330 | |
---|
| 331 | |
---|
[2243] | 332 | CALL pbl_surface_init(fder, snsrf, qsolsrf, tsoil) |
---|
[1529] | 333 | |
---|
[1992] | 334 | PRINT *, 'iniaqua: before phyredem' |
---|
[1529] | 335 | |
---|
[3435] | 336 | pbl_tke(:,:,:) = 1.e-8 |
---|
[1992] | 337 | falb1 = albedo |
---|
| 338 | falb2 = albedo |
---|
| 339 | zmax0 = 0. |
---|
| 340 | f0 = 0. |
---|
| 341 | sig1 = 0. |
---|
| 342 | w01 = 0. |
---|
| 343 | wake_deltat = 0. |
---|
| 344 | wake_deltaq = 0. |
---|
| 345 | wake_s = 0. |
---|
[3435] | 346 | wake_dens = 0. |
---|
[1992] | 347 | wake_cstar = 0. |
---|
| 348 | wake_pe = 0. |
---|
| 349 | wake_fip = 0. |
---|
| 350 | fm_therm = 0. |
---|
| 351 | entr_therm = 0. |
---|
| 352 | detr_therm = 0. |
---|
[2827] | 353 | ale_bl = 0. |
---|
| 354 | ale_bl_trig =0. |
---|
| 355 | alp_bl =0. |
---|
[2979] | 356 | treedrg(:,:,:)=0. |
---|
[1529] | 357 | |
---|
[3579] | 358 | u10m = 0. |
---|
| 359 | v10m = 0. |
---|
| 360 | |
---|
| 361 | ql_ancien = 0. |
---|
| 362 | qs_ancien = 0. |
---|
[4523] | 363 | qbs_ancien = 0. |
---|
[3579] | 364 | u_ancien = 0. |
---|
| 365 | v_ancien = 0. |
---|
| 366 | prw_ancien = 0. |
---|
| 367 | prlw_ancien = 0. |
---|
| 368 | prsw_ancien = 0. |
---|
[4523] | 369 | prbsw_ancien= 0. |
---|
[3579] | 370 | |
---|
| 371 | ale_wake = 0. |
---|
| 372 | ale_bl_stat = 0. |
---|
| 373 | |
---|
| 374 | |
---|
[3435] | 375 | !ym error : the sub surface dimension is the third not second : forgotten for iniaqua |
---|
| 376 | ! falb_dir(:,is_ter,:)=0.08; falb_dir(:,is_lic,:)=0.6 |
---|
| 377 | ! falb_dir(:,is_oce,:)=0.5; falb_dir(:,is_sic,:)=0.6 |
---|
| 378 | falb_dir(:,:,is_ter)=0.08; falb_dir(:,:,is_lic)=0.6 |
---|
| 379 | falb_dir(:,:,is_oce)=0.5; falb_dir(:,:,is_sic)=0.6 |
---|
[1529] | 380 | |
---|
[3435] | 381 | !ym falb_dif has been forgotten, initialize with defaukt value found in phyetat0 or 0 ? |
---|
| 382 | !ym probably the uninitialized value was 0 for standard (regular grid) case |
---|
| 383 | falb_dif(:,:,:)=0 |
---|
| 384 | |
---|
| 385 | |
---|
[1992] | 386 | CALL phyredem('startphy.nc') |
---|
[1529] | 387 | |
---|
[1992] | 388 | PRINT *, 'iniaqua: after phyredem' |
---|
| 389 | CALL phys_state_var_end |
---|
[1529] | 390 | |
---|
[1992] | 391 | RETURN |
---|
| 392 | END SUBROUTINE iniaqua |
---|
[1529] | 393 | |
---|
| 394 | |
---|
[1992] | 395 | ! ==================================================================== |
---|
| 396 | ! ==================================================================== |
---|
| 397 | SUBROUTINE zenang_an(cycle_diurne, gmtime, rlat, rlon, rmu0, fract) |
---|
[5285] | 398 | USE yomcst_mod_h |
---|
[1992] | 399 | USE dimphy |
---|
| 400 | IMPLICIT NONE |
---|
| 401 | ! ==================================================================== |
---|
| 402 | ! ============================================================= |
---|
| 403 | ! CALL zenang(cycle_diurne,gmtime,rlat,rlon,rmu0,fract) |
---|
| 404 | ! Auteur : A. Campoy et F. Hourdin |
---|
| 405 | ! Objet : calculer les valeurs moyennes du cos de l'angle zenithal |
---|
| 406 | ! et l'ensoleillement moyen entre gmtime1 et gmtime2 |
---|
| 407 | ! connaissant la declinaison, la latitude et la longitude. |
---|
[1529] | 408 | |
---|
[1992] | 409 | ! Dans cette version particuliere, on calcule le rayonnement |
---|
| 410 | ! moyen sur l'année à chaque latitude. |
---|
| 411 | ! angle zenithal calculé pour obtenir un |
---|
| 412 | ! Fit polynomial de l'ensoleillement moyen au sommet de l'atmosphere |
---|
| 413 | ! en moyenne annuelle. |
---|
| 414 | ! Spécifique de la terre. Utilisé pour les aqua planetes. |
---|
[1529] | 415 | |
---|
[1992] | 416 | ! Rque : Different de la routine angle en ce sens que zenang |
---|
| 417 | ! fournit des moyennes de pmu0 et non des valeurs |
---|
| 418 | ! instantanees, du coup frac prend toutes les valeurs |
---|
| 419 | ! entre 0 et 1. |
---|
| 420 | ! Date : premiere version le 13 decembre 1994 |
---|
| 421 | ! revu pour GCM le 30 septembre 1996 |
---|
| 422 | ! =============================================================== |
---|
| 423 | ! longi----INPUT : la longitude vraie de la terre dans son plan |
---|
| 424 | ! solaire a partir de l'equinoxe de printemps (degre) |
---|
| 425 | ! gmtime---INPUT : temps universel en fraction de jour |
---|
| 426 | ! pdtrad---INPUT : pas de temps du rayonnement (secondes) |
---|
| 427 | ! lat------INPUT : latitude en degres |
---|
| 428 | ! long-----INPUT : longitude en degres |
---|
| 429 | ! pmu0-----OUTPUT: angle zenithal moyen entre gmtime et gmtime+pdtrad |
---|
| 430 | ! frac-----OUTPUT: ensoleillement moyen entre gmtime et gmtime+pdtrad |
---|
| 431 | ! ================================================================ |
---|
| 432 | ! ================================================================ |
---|
| 433 | LOGICAL cycle_diurne |
---|
| 434 | REAL gmtime |
---|
| 435 | REAL rlat(klon), rlon(klon), rmu0(klon), fract(klon) |
---|
| 436 | ! ================================================================ |
---|
| 437 | INTEGER i |
---|
| 438 | REAL gmtime1, gmtime2 |
---|
| 439 | REAL pi_local |
---|
[1529] | 440 | |
---|
| 441 | |
---|
[1992] | 442 | REAL rmu0m(klon), rmu0a(klon) |
---|
[1529] | 443 | |
---|
| 444 | |
---|
[1992] | 445 | pi_local = 4.0*atan(1.0) |
---|
[1529] | 446 | |
---|
[1992] | 447 | ! ================================================================ |
---|
| 448 | ! Calcul de l'angle zenithal moyen sur la journee |
---|
| 449 | ! ================================================================ |
---|
| 450 | |
---|
| 451 | DO i = 1, klon |
---|
| 452 | fract(i) = 1. |
---|
| 453 | ! Calcule du flux moyen |
---|
| 454 | IF (abs(rlat(i))<=28.75) THEN |
---|
| 455 | rmu0m(i) = (210.1924+206.6059*cos(0.0174533*rlat(i))**2)/1365. |
---|
| 456 | ELSE IF (abs(rlat(i))<=43.75) THEN |
---|
| 457 | rmu0m(i) = (187.4562+236.1853*cos(0.0174533*rlat(i))**2)/1365. |
---|
| 458 | ELSE IF (abs(rlat(i))<=71.25) THEN |
---|
| 459 | rmu0m(i) = (162.4439+284.1192*cos(0.0174533*rlat(i))**2)/1365. |
---|
[1529] | 460 | ELSE |
---|
[1992] | 461 | rmu0m(i) = (172.8125+183.7673*cos(0.0174533*rlat(i))**2)/1365. |
---|
| 462 | END IF |
---|
| 463 | END DO |
---|
[1529] | 464 | |
---|
[1992] | 465 | ! ================================================================ |
---|
| 466 | ! Avec ou sans cycle diurne |
---|
| 467 | ! ================================================================ |
---|
[1529] | 468 | |
---|
[1992] | 469 | IF (cycle_diurne) THEN |
---|
[1529] | 470 | |
---|
[1992] | 471 | ! On redecompose flux au sommet suivant un cycle diurne idealise |
---|
| 472 | ! identique a toutes les latitudes. |
---|
[1671] | 473 | |
---|
[1992] | 474 | DO i = 1, klon |
---|
| 475 | rmu0a(i) = 2.*rmu0m(i)*sqrt(2.)*pi_local/(4.-pi_local) |
---|
| 476 | rmu0(i) = rmu0a(i)*abs(sin(pi_local*gmtime+pi_local*rlon(i)/360.)) - & |
---|
| 477 | rmu0a(i)/sqrt(2.) |
---|
| 478 | END DO |
---|
[1671] | 479 | |
---|
[1992] | 480 | DO i = 1, klon |
---|
| 481 | IF (rmu0(i)<=0.) THEN |
---|
| 482 | rmu0(i) = 0. |
---|
| 483 | fract(i) = 0. |
---|
| 484 | ELSE |
---|
| 485 | fract(i) = 1. |
---|
| 486 | END IF |
---|
| 487 | END DO |
---|
[1671] | 488 | |
---|
[1992] | 489 | ! Affichage de l'angel zenitale |
---|
| 490 | ! print*,'************************************' |
---|
| 491 | ! print*,'************************************' |
---|
| 492 | ! print*,'************************************' |
---|
| 493 | ! print*,'latitude=',rlat(i),'longitude=',rlon(i) |
---|
| 494 | ! print*,'rmu0m=',rmu0m(i) |
---|
| 495 | ! print*,'rmu0a=',rmu0a(i) |
---|
| 496 | ! print*,'rmu0=',rmu0(i) |
---|
[1529] | 497 | |
---|
[1992] | 498 | ELSE |
---|
[1671] | 499 | |
---|
[1992] | 500 | DO i = 1, klon |
---|
| 501 | fract(i) = 0.5 |
---|
| 502 | rmu0(i) = rmu0m(i)*2. |
---|
| 503 | END DO |
---|
| 504 | |
---|
| 505 | END IF |
---|
| 506 | |
---|
| 507 | RETURN |
---|
| 508 | END SUBROUTINE zenang_an |
---|
| 509 | |
---|
| 510 | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
| 511 | |
---|
[3435] | 512 | SUBROUTINE writelim_unstruct(klon, phy_nat, phy_alb, phy_sst, phy_bil, phy_rug, & |
---|
| 513 | phy_ice, phy_fter, phy_foce, phy_flic, phy_fsic) |
---|
| 514 | |
---|
| 515 | USE mod_phys_lmdz_para, ONLY: is_omp_master, klon_mpi |
---|
| 516 | USE mod_phys_lmdz_transfert_para, ONLY: gather_omp |
---|
[4619] | 517 | USE lmdz_xios |
---|
[3435] | 518 | IMPLICIT NONE |
---|
| 519 | |
---|
| 520 | INTEGER, INTENT (IN) :: klon |
---|
| 521 | REAL, INTENT (IN) :: phy_nat(klon, 360) |
---|
| 522 | REAL, INTENT (IN) :: phy_alb(klon, 360) |
---|
| 523 | REAL, INTENT (IN) :: phy_sst(klon, 360) |
---|
| 524 | REAL, INTENT (IN) :: phy_bil(klon, 360) |
---|
| 525 | REAL, INTENT (IN) :: phy_rug(klon, 360) |
---|
| 526 | REAL, INTENT (IN) :: phy_ice(klon, 360) |
---|
| 527 | REAL, INTENT (IN) :: phy_fter(klon, 360) |
---|
| 528 | REAL, INTENT (IN) :: phy_foce(klon, 360) |
---|
| 529 | REAL, INTENT (IN) :: phy_flic(klon, 360) |
---|
| 530 | REAL, INTENT (IN) :: phy_fsic(klon, 360) |
---|
| 531 | |
---|
| 532 | REAL :: phy_mpi(klon_mpi, 360) ! temporary variable, to store phy_***(:) |
---|
| 533 | ! on the whole physics grid |
---|
| 534 | |
---|
[4619] | 535 | IF (using_xios) THEN |
---|
| 536 | PRINT *, 'writelim: Ecriture du fichier limit' |
---|
[3435] | 537 | |
---|
[4619] | 538 | CALL gather_omp(phy_foce, phy_mpi) |
---|
| 539 | IF (is_omp_master) CALL xios_send_field('foce_limout',phy_mpi) |
---|
[3435] | 540 | |
---|
[4619] | 541 | CALL gather_omp(phy_fsic, phy_mpi) |
---|
| 542 | IF (is_omp_master) CALL xios_send_field('fsic_limout',phy_mpi) |
---|
[3435] | 543 | |
---|
[4619] | 544 | CALL gather_omp(phy_fter, phy_mpi) |
---|
| 545 | IF (is_omp_master) CALL xios_send_field('fter_limout',phy_mpi) |
---|
[3435] | 546 | |
---|
[4619] | 547 | CALL gather_omp(phy_flic, phy_mpi) |
---|
| 548 | IF (is_omp_master) CALL xios_send_field('flic_limout',phy_mpi) |
---|
[3435] | 549 | |
---|
[4619] | 550 | CALL gather_omp(phy_sst, phy_mpi) |
---|
| 551 | IF (is_omp_master) CALL xios_send_field('sst_limout',phy_mpi) |
---|
[3435] | 552 | |
---|
[4619] | 553 | CALL gather_omp(phy_bil, phy_mpi) |
---|
| 554 | IF (is_omp_master) CALL xios_send_field('bils_limout',phy_mpi) |
---|
[3435] | 555 | |
---|
[4619] | 556 | CALL gather_omp(phy_alb, phy_mpi) |
---|
| 557 | IF (is_omp_master) CALL xios_send_field('alb_limout',phy_mpi) |
---|
[3435] | 558 | |
---|
[4619] | 559 | CALL gather_omp(phy_rug, phy_mpi) |
---|
| 560 | IF (is_omp_master) CALL xios_send_field('rug_limout',phy_mpi) |
---|
| 561 | ENDIF |
---|
[3435] | 562 | END SUBROUTINE writelim_unstruct |
---|
| 563 | |
---|
| 564 | |
---|
| 565 | |
---|
[1992] | 566 | SUBROUTINE writelim(klon, phy_nat, phy_alb, phy_sst, phy_bil, phy_rug, & |
---|
| 567 | phy_ice, phy_fter, phy_foce, phy_flic, phy_fsic) |
---|
| 568 | |
---|
[3435] | 569 | USE mod_phys_lmdz_para, ONLY: is_master |
---|
[1992] | 570 | USE mod_grid_phy_lmdz, ONLY: klon_glo |
---|
| 571 | USE mod_phys_lmdz_transfert_para, ONLY: gather |
---|
[3540] | 572 | USE phys_cal_mod, ONLY: year_len |
---|
[5270] | 573 | USE netcdf, ONLY: nf90_def_var, nf90_put_var, nf90_get_var, nf90_strerror, nf90_close, & |
---|
| 574 | nf90_enddef, nf90_put_att, nf90_unlimited, nf90_noerr, nf90_global, nf90_clobber, & |
---|
| 575 | nf90_64bit_offset, nf90_def_dim, nf90_create |
---|
[5249] | 576 | USE lmdz_cppkeys_wrapper, ONLY: nf90_format |
---|
[1992] | 577 | IMPLICIT NONE |
---|
| 578 | |
---|
| 579 | INTEGER, INTENT (IN) :: klon |
---|
[3540] | 580 | REAL, INTENT (IN) :: phy_nat(klon, year_len) |
---|
| 581 | REAL, INTENT (IN) :: phy_alb(klon, year_len) |
---|
| 582 | REAL, INTENT (IN) :: phy_sst(klon, year_len) |
---|
| 583 | REAL, INTENT (IN) :: phy_bil(klon, year_len) |
---|
| 584 | REAL, INTENT (IN) :: phy_rug(klon, year_len) |
---|
| 585 | REAL, INTENT (IN) :: phy_ice(klon, year_len) |
---|
| 586 | REAL, INTENT (IN) :: phy_fter(klon, year_len) |
---|
| 587 | REAL, INTENT (IN) :: phy_foce(klon, year_len) |
---|
| 588 | REAL, INTENT (IN) :: phy_flic(klon, year_len) |
---|
| 589 | REAL, INTENT (IN) :: phy_fsic(klon, year_len) |
---|
[1992] | 590 | |
---|
[3540] | 591 | REAL :: phy_glo(klon_glo, year_len) ! temporary variable, to store phy_***(:) |
---|
[1992] | 592 | ! on the whole physics grid |
---|
| 593 | INTEGER :: k |
---|
| 594 | INTEGER ierr |
---|
| 595 | INTEGER dimfirst(3) |
---|
| 596 | INTEGER dimlast(3) |
---|
| 597 | |
---|
| 598 | INTEGER nid, ndim, ntim |
---|
| 599 | INTEGER dims(2), debut(2), epais(2) |
---|
| 600 | INTEGER id_tim |
---|
| 601 | INTEGER id_nat, id_sst, id_bils, id_rug, id_alb |
---|
| 602 | INTEGER id_fter, id_foce, id_fsic, id_flic |
---|
| 603 | |
---|
[3435] | 604 | IF (is_master) THEN |
---|
[1992] | 605 | |
---|
| 606 | PRINT *, 'writelim: Ecriture du fichier limit' |
---|
| 607 | |
---|
[5270] | 608 | ierr = nf90_create('limit.nc', IOR(nf90_clobber,nf90_64bit_offset), nid) |
---|
[1992] | 609 | |
---|
[5270] | 610 | ierr = nf90_put_att(nid, nf90_global, 'title', 'Fichier conditions aux limites') |
---|
| 611 | ! ! ierr = nf90_def_dim (nid, "points_physiques", klon, ndim) |
---|
| 612 | ierr = nf90_def_dim(nid, 'points_physiques', klon_glo, ndim) |
---|
| 613 | ierr = nf90_def_dim(nid, 'time', nf90_unlimited, ntim) |
---|
[1992] | 614 | |
---|
| 615 | dims(1) = ndim |
---|
| 616 | dims(2) = ntim |
---|
| 617 | |
---|
[5249] | 618 | ierr = nf90_def_var(nid, 'TEMPS', nf90_format, [ntim], id_tim) |
---|
[5270] | 619 | ierr = nf90_put_att(nid, id_tim, 'title', 'Jour dans l annee') |
---|
[2198] | 620 | |
---|
[5249] | 621 | ierr = nf90_def_var(nid, 'NAT', nf90_format, dims, id_nat) |
---|
[5270] | 622 | ierr = nf90_put_att(nid, id_nat, 'title', 'Nature du sol (0,1,2,3)') |
---|
[2198] | 623 | |
---|
[5249] | 624 | ierr = nf90_def_var(nid, 'SST', nf90_format, dims, id_sst) |
---|
[5270] | 625 | ierr = nf90_put_att(nid, id_sst, 'title', 'Temperature superficielle de la mer') |
---|
[2198] | 626 | |
---|
[5249] | 627 | ierr = nf90_def_var(nid, 'BILS', nf90_format, dims, id_bils) |
---|
[5270] | 628 | ierr = nf90_put_att(nid, id_bils, 'title', 'Reference flux de chaleur au sol') |
---|
[2198] | 629 | |
---|
[5249] | 630 | ierr = nf90_def_var(nid, 'ALB', nf90_format, dims, id_alb) |
---|
[5270] | 631 | ierr = nf90_put_att(nid, id_alb, 'title', 'Albedo a la surface') |
---|
[2198] | 632 | |
---|
[5249] | 633 | ierr = nf90_def_var(nid, 'RUG', nf90_format, dims, id_rug) |
---|
[5270] | 634 | ierr = nf90_put_att(nid, id_rug, 'title', 'Rugosite') |
---|
[1992] | 635 | |
---|
[5249] | 636 | ierr = nf90_def_var(nid, 'FTER', nf90_format, dims, id_fter) |
---|
[5270] | 637 | ierr = nf90_put_att(nid, id_fter, 'title','Frac. Land') |
---|
[5249] | 638 | ierr = nf90_def_var(nid, 'FOCE', nf90_format, dims, id_foce) |
---|
[5270] | 639 | ierr = nf90_put_att(nid, id_foce, 'title','Frac. Ocean') |
---|
[5249] | 640 | ierr = nf90_def_var(nid, 'FSIC', nf90_format, dims, id_fsic) |
---|
[5270] | 641 | ierr = nf90_put_att(nid, id_fsic, 'title','Frac. Sea Ice') |
---|
[5249] | 642 | ierr = nf90_def_var(nid, 'FLIC', nf90_format, dims, id_flic) |
---|
[5270] | 643 | ierr = nf90_put_att(nid, id_flic, 'title','Frac. Land Ice') |
---|
[1992] | 644 | |
---|
[5270] | 645 | ierr = nf90_enddef(nid) |
---|
| 646 | IF (ierr/=nf90_noerr) THEN |
---|
[1992] | 647 | WRITE (*, *) 'writelim error: failed to end define mode' |
---|
[5270] | 648 | WRITE (*, *) nf90_strerror(ierr) |
---|
[1992] | 649 | END IF |
---|
| 650 | |
---|
| 651 | |
---|
| 652 | ! write the 'times' |
---|
[3540] | 653 | DO k = 1, year_len |
---|
[5249] | 654 | ierr = nf90_put_var(nid, id_tim, k, [k]) |
---|
[5270] | 655 | IF (ierr/=nf90_noerr) THEN |
---|
[1992] | 656 | WRITE (*, *) 'writelim error with temps(k),k=', k |
---|
[5270] | 657 | WRITE (*, *) nf90_strerror(ierr) |
---|
[1992] | 658 | END IF |
---|
| 659 | END DO |
---|
[1529] | 660 | |
---|
[3435] | 661 | END IF ! of if (is_master) |
---|
[1671] | 662 | |
---|
[1992] | 663 | ! write the fields, after having collected them on master |
---|
[1671] | 664 | |
---|
[1992] | 665 | CALL gather(phy_nat, phy_glo) |
---|
[3435] | 666 | IF (is_master) THEN |
---|
[5249] | 667 | ierr = nf90_put_var(nid, id_nat, phy_glo) |
---|
[5270] | 668 | IF (ierr/=nf90_noerr) THEN |
---|
[1992] | 669 | WRITE (*, *) 'writelim error with phy_nat' |
---|
[5270] | 670 | WRITE (*, *) nf90_strerror(ierr) |
---|
[1992] | 671 | END IF |
---|
| 672 | END IF |
---|
[1671] | 673 | |
---|
[1992] | 674 | CALL gather(phy_sst, phy_glo) |
---|
[3435] | 675 | IF (is_master) THEN |
---|
[5249] | 676 | ierr = nf90_put_var(nid, id_sst, phy_glo) |
---|
[5270] | 677 | IF (ierr/=nf90_noerr) THEN |
---|
[1992] | 678 | WRITE (*, *) 'writelim error with phy_sst' |
---|
[5270] | 679 | WRITE (*, *) nf90_strerror(ierr) |
---|
[1992] | 680 | END IF |
---|
| 681 | END IF |
---|
[1671] | 682 | |
---|
[1992] | 683 | CALL gather(phy_bil, phy_glo) |
---|
[3435] | 684 | IF (is_master) THEN |
---|
[5249] | 685 | ierr = nf90_put_var(nid, id_bils, phy_glo) |
---|
[5270] | 686 | IF (ierr/=nf90_noerr) THEN |
---|
[1992] | 687 | WRITE (*, *) 'writelim error with phy_bil' |
---|
[5270] | 688 | WRITE (*, *) nf90_strerror(ierr) |
---|
[1992] | 689 | END IF |
---|
| 690 | END IF |
---|
[1671] | 691 | |
---|
[1992] | 692 | CALL gather(phy_alb, phy_glo) |
---|
[3435] | 693 | IF (is_master) THEN |
---|
[5249] | 694 | ierr = nf90_put_var(nid, id_alb, phy_glo) |
---|
[5270] | 695 | IF (ierr/=nf90_noerr) THEN |
---|
[1992] | 696 | WRITE (*, *) 'writelim error with phy_alb' |
---|
[5270] | 697 | WRITE (*, *) nf90_strerror(ierr) |
---|
[1992] | 698 | END IF |
---|
| 699 | END IF |
---|
[1671] | 700 | |
---|
[1992] | 701 | CALL gather(phy_rug, phy_glo) |
---|
[3435] | 702 | IF (is_master) THEN |
---|
[5249] | 703 | ierr = nf90_put_var(nid, id_rug, phy_glo) |
---|
[5270] | 704 | IF (ierr/=nf90_noerr) THEN |
---|
[1992] | 705 | WRITE (*, *) 'writelim error with phy_rug' |
---|
[5270] | 706 | WRITE (*, *) nf90_strerror(ierr) |
---|
[1992] | 707 | END IF |
---|
| 708 | END IF |
---|
[1671] | 709 | |
---|
[1992] | 710 | CALL gather(phy_fter, phy_glo) |
---|
[3435] | 711 | IF (is_master) THEN |
---|
[5249] | 712 | ierr = nf90_put_var(nid, id_fter, phy_glo) |
---|
[5270] | 713 | IF (ierr/=nf90_noerr) THEN |
---|
[1992] | 714 | WRITE (*, *) 'writelim error with phy_fter' |
---|
[5270] | 715 | WRITE (*, *) nf90_strerror(ierr) |
---|
[1992] | 716 | END IF |
---|
| 717 | END IF |
---|
[1671] | 718 | |
---|
[1992] | 719 | CALL gather(phy_foce, phy_glo) |
---|
[3435] | 720 | IF (is_master) THEN |
---|
[5249] | 721 | ierr = nf90_put_var(nid, id_foce, phy_glo) |
---|
[5270] | 722 | IF (ierr/=nf90_noerr) THEN |
---|
[1992] | 723 | WRITE (*, *) 'writelim error with phy_foce' |
---|
[5270] | 724 | WRITE (*, *) nf90_strerror(ierr) |
---|
[1992] | 725 | END IF |
---|
| 726 | END IF |
---|
[1671] | 727 | |
---|
[1992] | 728 | CALL gather(phy_fsic, phy_glo) |
---|
[3435] | 729 | IF (is_master) THEN |
---|
[5249] | 730 | ierr = nf90_put_var(nid, id_fsic, phy_glo) |
---|
[5270] | 731 | IF (ierr/=nf90_noerr) THEN |
---|
[1992] | 732 | WRITE (*, *) 'writelim error with phy_fsic' |
---|
[5270] | 733 | WRITE (*, *) nf90_strerror(ierr) |
---|
[1992] | 734 | END IF |
---|
| 735 | END IF |
---|
[1671] | 736 | |
---|
[1992] | 737 | CALL gather(phy_flic, phy_glo) |
---|
[3435] | 738 | IF (is_master) THEN |
---|
[5249] | 739 | ierr = nf90_put_var(nid, id_flic, phy_glo) |
---|
[5270] | 740 | IF (ierr/=nf90_noerr) THEN |
---|
[1992] | 741 | WRITE (*, *) 'writelim error with phy_flic' |
---|
[5270] | 742 | WRITE (*, *) nf90_strerror(ierr) |
---|
[1992] | 743 | END IF |
---|
| 744 | END IF |
---|
[1671] | 745 | |
---|
[1992] | 746 | ! close file: |
---|
[3435] | 747 | IF (is_master) THEN |
---|
[5270] | 748 | ierr = nf90_close(nid) |
---|
[1992] | 749 | END IF |
---|
[1671] | 750 | |
---|
[1992] | 751 | END SUBROUTINE writelim |
---|
[1529] | 752 | |
---|
[1992] | 753 | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
[1671] | 754 | |
---|
[1992] | 755 | SUBROUTINE profil_sst(nlon, rlatd, type_profil, phy_sst) |
---|
| 756 | USE dimphy |
---|
[3540] | 757 | USE phys_cal_mod , ONLY: year_len |
---|
[1992] | 758 | IMPLICIT NONE |
---|
[1529] | 759 | |
---|
[1992] | 760 | INTEGER nlon, type_profil, i, k, j |
---|
[3540] | 761 | REAL :: rlatd(nlon), phy_sst(nlon, year_len) |
---|
[1992] | 762 | INTEGER imn, imx, amn, amx, kmn, kmx |
---|
| 763 | INTEGER p, pplus, nlat_max |
---|
| 764 | PARAMETER (nlat_max=72) |
---|
| 765 | REAL x_anom_sst(nlat_max) |
---|
[3531] | 766 | CHARACTER (LEN=20) :: modname='profil_sst' |
---|
| 767 | CHARACTER (LEN=80) :: abort_message |
---|
[1529] | 768 | |
---|
[3531] | 769 | IF (klon/=nlon) THEN |
---|
| 770 | abort_message='probleme de dimensions dans profil_sst' |
---|
| 771 | CALL abort_physic(modname,abort_message,1) |
---|
| 772 | ENDIF |
---|
[1992] | 773 | WRITE (*, *) ' profil_sst: type_profil=', type_profil |
---|
[3540] | 774 | DO i = 1, year_len |
---|
[1992] | 775 | ! phy_sst(:,i) = 260.+50.*cos(rlatd(:))**2 |
---|
[1529] | 776 | |
---|
[1992] | 777 | ! Rajout fbrlmd |
---|
[1529] | 778 | |
---|
[1992] | 779 | IF (type_profil==1) THEN |
---|
| 780 | ! Méthode 1 "Control" faible plateau à l'Equateur |
---|
| 781 | DO j = 1, klon |
---|
| 782 | phy_sst(j, i) = 273. + 27.*(1-sin(1.5*rlatd(j))**2) |
---|
| 783 | ! PI/3=1.047197551 |
---|
| 784 | IF ((rlatd(j)>1.0471975) .OR. (rlatd(j)<-1.0471975)) THEN |
---|
| 785 | phy_sst(j, i) = 273. |
---|
| 786 | END IF |
---|
| 787 | END DO |
---|
| 788 | END IF |
---|
| 789 | IF (type_profil==2) THEN |
---|
| 790 | ! Méthode 2 "Flat" fort plateau à l'Equateur |
---|
| 791 | DO j = 1, klon |
---|
| 792 | phy_sst(j, i) = 273. + 27.*(1-sin(1.5*rlatd(j))**4) |
---|
| 793 | IF ((rlatd(j)>1.0471975) .OR. (rlatd(j)<-1.0471975)) THEN |
---|
| 794 | phy_sst(j, i) = 273. |
---|
| 795 | END IF |
---|
| 796 | END DO |
---|
| 797 | END IF |
---|
[1529] | 798 | |
---|
| 799 | |
---|
[1992] | 800 | IF (type_profil==3) THEN |
---|
| 801 | ! Méthode 3 "Qobs" plateau réel à l'Equateur |
---|
| 802 | DO j = 1, klon |
---|
| 803 | phy_sst(j, i) = 273. + 0.5*27.*(2-sin(1.5*rlatd(j))**2-sin(1.5* & |
---|
| 804 | rlatd(j))**4) |
---|
| 805 | IF ((rlatd(j)>1.0471975) .OR. (rlatd(j)<-1.0471975)) THEN |
---|
| 806 | phy_sst(j, i) = 273. |
---|
| 807 | END IF |
---|
| 808 | END DO |
---|
| 809 | END IF |
---|
[1529] | 810 | |
---|
[1992] | 811 | IF (type_profil==4) THEN |
---|
| 812 | ! Méthode 4 : Méthode 3 + SST+2 "Qobs" plateau réel à l'Equateur |
---|
| 813 | DO j = 1, klon |
---|
| 814 | phy_sst(j, i) = 273. + 0.5*29.*(2-sin(1.5*rlatd(j))**2-sin(1.5* & |
---|
| 815 | rlatd(j))**4) |
---|
| 816 | IF ((rlatd(j)>1.0471975) .OR. (rlatd(j)<-1.0471975)) THEN |
---|
| 817 | phy_sst(j, i) = 273. |
---|
| 818 | END IF |
---|
| 819 | END DO |
---|
| 820 | END IF |
---|
[1529] | 821 | |
---|
[1992] | 822 | IF (type_profil==5) THEN |
---|
| 823 | ! Méthode 5 : Méthode 3 + +2K "Qobs" plateau réel à l'Equateur |
---|
| 824 | DO j = 1, klon |
---|
| 825 | phy_sst(j, i) = 273. + 2. + 0.5*27.*(2-sin(1.5*rlatd(j))**2-sin(1.5 & |
---|
| 826 | *rlatd(j))**4) |
---|
| 827 | IF ((rlatd(j)>1.0471975) .OR. (rlatd(j)<-1.0471975)) THEN |
---|
| 828 | phy_sst(j, i) = 273. + 2. |
---|
| 829 | END IF |
---|
[1529] | 830 | |
---|
[1992] | 831 | END DO |
---|
| 832 | END IF |
---|
[1529] | 833 | |
---|
[1992] | 834 | IF (type_profil==6) THEN |
---|
| 835 | ! Méthode 6 "cst" valeur constante de SST |
---|
| 836 | DO j = 1, klon |
---|
| 837 | phy_sst(j, i) = 288. |
---|
| 838 | END DO |
---|
| 839 | END IF |
---|
[1529] | 840 | |
---|
| 841 | |
---|
[1992] | 842 | IF (type_profil==7) THEN |
---|
| 843 | ! Méthode 7 "cst" valeur constante de SST +2 |
---|
| 844 | DO j = 1, klon |
---|
| 845 | phy_sst(j, i) = 288. + 2. |
---|
| 846 | END DO |
---|
| 847 | END IF |
---|
[1529] | 848 | |
---|
[1992] | 849 | p = 0 |
---|
| 850 | IF (type_profil==8) THEN |
---|
| 851 | ! Méthode 8 profil anomalies SST du modèle couplé AR4 |
---|
| 852 | DO j = 1, klon |
---|
| 853 | IF (rlatd(j)==rlatd(j-1)) THEN |
---|
| 854 | phy_sst(j, i) = 273. + x_anom_sst(pplus) + & |
---|
| 855 | 0.5*27.*(2-sin(1.5*rlatd(j))**2-sin(1.5*rlatd(j))**4) |
---|
| 856 | IF ((rlatd(j)>1.0471975) .OR. (rlatd(j)<-1.0471975)) THEN |
---|
| 857 | phy_sst(j, i) = 273. + x_anom_sst(pplus) |
---|
| 858 | END IF |
---|
| 859 | ELSE |
---|
| 860 | p = p + 1 |
---|
| 861 | pplus = 73 - p |
---|
| 862 | phy_sst(j, i) = 273. + x_anom_sst(pplus) + & |
---|
| 863 | 0.5*27.*(2-sin(1.5*rlatd(j))**2-sin(1.5*rlatd(j))**4) |
---|
| 864 | IF ((rlatd(j)>1.0471975) .OR. (rlatd(j)<-1.0471975)) THEN |
---|
| 865 | phy_sst(j, i) = 273. + x_anom_sst(pplus) |
---|
| 866 | END IF |
---|
| 867 | WRITE (*, *) rlatd(j), x_anom_sst(pplus), phy_sst(j, i) |
---|
| 868 | END IF |
---|
| 869 | END DO |
---|
| 870 | END IF |
---|
[1529] | 871 | |
---|
[1992] | 872 | IF (type_profil==9) THEN |
---|
| 873 | ! Méthode 5 : Méthode 3 + -2K "Qobs" plateau réel à l'Equateur |
---|
| 874 | DO j = 1, klon |
---|
| 875 | phy_sst(j, i) = 273. - 2. + 0.5*27.*(2-sin(1.5*rlatd(j))**2-sin(1.5 & |
---|
| 876 | *rlatd(j))**4) |
---|
| 877 | IF ((rlatd(j)>1.0471975) .OR. (rlatd(j)<-1.0471975)) THEN |
---|
| 878 | phy_sst(j, i) = 273. - 2. |
---|
| 879 | END IF |
---|
| 880 | END DO |
---|
| 881 | END IF |
---|
[1529] | 882 | |
---|
| 883 | |
---|
[1992] | 884 | IF (type_profil==10) THEN |
---|
| 885 | ! Méthode 10 : Méthode 3 + +4K "Qobs" plateau réel à l'Equateur |
---|
| 886 | DO j = 1, klon |
---|
| 887 | phy_sst(j, i) = 273. + 4. + 0.5*27.*(2-sin(1.5*rlatd(j))**2-sin(1.5 & |
---|
| 888 | *rlatd(j))**4) |
---|
| 889 | IF ((rlatd(j)>1.0471975) .OR. (rlatd(j)<-1.0471975)) THEN |
---|
| 890 | phy_sst(j, i) = 273. + 4. |
---|
| 891 | END IF |
---|
| 892 | END DO |
---|
| 893 | END IF |
---|
[1529] | 894 | |
---|
[1992] | 895 | IF (type_profil==11) THEN |
---|
| 896 | ! Méthode 11 : Méthode 3 + 4CO2 "Qobs" plateau réel à l'Equateur |
---|
| 897 | DO j = 1, klon |
---|
| 898 | phy_sst(j, i) = 273. + 0.5*27.*(2-sin(1.5*rlatd(j))**2-sin(1.5* & |
---|
| 899 | rlatd(j))**4) |
---|
| 900 | IF ((rlatd(j)>1.0471975) .OR. (rlatd(j)<-1.0471975)) THEN |
---|
| 901 | phy_sst(j, i) = 273. |
---|
| 902 | END IF |
---|
| 903 | END DO |
---|
| 904 | END IF |
---|
[1529] | 905 | |
---|
[1992] | 906 | IF (type_profil==12) THEN |
---|
| 907 | ! Méthode 12 : Méthode 10 + 4CO2 "Qobs" plateau réel à l'Equateur |
---|
| 908 | DO j = 1, klon |
---|
| 909 | phy_sst(j, i) = 273. + 4. + 0.5*27.*(2-sin(1.5*rlatd(j))**2-sin(1.5 & |
---|
| 910 | *rlatd(j))**4) |
---|
| 911 | IF ((rlatd(j)>1.0471975) .OR. (rlatd(j)<-1.0471975)) THEN |
---|
| 912 | phy_sst(j, i) = 273. + 4. |
---|
| 913 | END IF |
---|
| 914 | END DO |
---|
| 915 | END IF |
---|
[1529] | 916 | |
---|
[1992] | 917 | IF (type_profil==13) THEN |
---|
| 918 | ! Méthode 13 "Qmax" plateau réel à l'Equateur augmenté ! |
---|
| 919 | DO j = 1, klon |
---|
| 920 | phy_sst(j, i) = 273. + 0.5*29.*(2-sin(1.5*rlatd(j))**2-sin(1.5* & |
---|
| 921 | rlatd(j))**4) |
---|
| 922 | IF ((rlatd(j)>1.0471975) .OR. (rlatd(j)<-1.0471975)) THEN |
---|
| 923 | phy_sst(j, i) = 273. |
---|
| 924 | END IF |
---|
| 925 | END DO |
---|
| 926 | END IF |
---|
[1529] | 927 | |
---|
[1992] | 928 | IF (type_profil==14) THEN |
---|
| 929 | ! Méthode 13 "Qmax2K" plateau réel à l'Equateur augmenté +2K ! |
---|
| 930 | DO j = 1, klon |
---|
| 931 | phy_sst(j, i) = 273. + 2. + 0.5*29.*(2-sin(1.5*rlatd(j))**2-sin(1.5 & |
---|
| 932 | *rlatd(j))**4) |
---|
| 933 | IF ((rlatd(j)>1.0471975) .OR. (rlatd(j)<-1.0471975)) THEN |
---|
| 934 | phy_sst(j, i) = 273. |
---|
| 935 | END IF |
---|
| 936 | END DO |
---|
| 937 | END IF |
---|
[1529] | 938 | |
---|
[5084] | 939 | if (type_profil.EQ.20) then |
---|
[2107] | 940 | print*,'Profile SST 20' |
---|
| 941 | ! Méthode 13 "Qmax2K" plateau réel �| l'Equateur augmenté +2K |
---|
| 942 | |
---|
| 943 | do j=1,klon |
---|
| 944 | phy_sst(j,i)=248.+55.*(1-sin(rlatd(j))**2) |
---|
| 945 | enddo |
---|
| 946 | endif |
---|
| 947 | |
---|
[5084] | 948 | if (type_profil.EQ.21) then |
---|
[2107] | 949 | print*,'Profile SST 21' |
---|
| 950 | ! Méthode 13 "Qmax2K" plateau réel �| l'Equateur augmenté +2K |
---|
| 951 | do j=1,klon |
---|
| 952 | phy_sst(j,i)=252.+55.*(1-sin(rlatd(j))**2) |
---|
| 953 | enddo |
---|
| 954 | endif |
---|
| 955 | |
---|
| 956 | |
---|
| 957 | |
---|
[1992] | 958 | END DO |
---|
| 959 | |
---|
| 960 | ! IM beg : verif profil SST: phy_sst |
---|
| 961 | amn = min(phy_sst(1,1), 1000.) |
---|
| 962 | amx = max(phy_sst(1,1), -1000.) |
---|
| 963 | imn = 1 |
---|
| 964 | kmn = 1 |
---|
| 965 | imx = 1 |
---|
| 966 | kmx = 1 |
---|
[3540] | 967 | DO k = 1, year_len |
---|
[1992] | 968 | DO i = 2, nlon |
---|
| 969 | IF (phy_sst(i,k)<amn) THEN |
---|
| 970 | amn = phy_sst(i, k) |
---|
| 971 | imn = i |
---|
| 972 | kmn = k |
---|
| 973 | END IF |
---|
| 974 | IF (phy_sst(i,k)>amx) THEN |
---|
| 975 | amx = phy_sst(i, k) |
---|
| 976 | imx = i |
---|
| 977 | kmx = k |
---|
| 978 | END IF |
---|
| 979 | END DO |
---|
| 980 | END DO |
---|
| 981 | |
---|
| 982 | PRINT *, 'profil_sst: imn, kmn, phy_sst(imn,kmn) ', imn, kmn, amn |
---|
| 983 | PRINT *, 'profil_sst: imx, kmx, phy_sst(imx,kmx) ', imx, kmx, amx |
---|
| 984 | ! IM end : verif profil SST: phy_sst |
---|
| 985 | |
---|
| 986 | RETURN |
---|
| 987 | END SUBROUTINE profil_sst |
---|
| 988 | |
---|
| 989 | END MODULE phyaqua_mod |
---|