[3540] | 1 | ! |
---|
| 2 | ! $Id: phyaqua_mod.F90 4253 2022-09-20 14:09:48Z lguez $ |
---|
| 3 | ! |
---|
[1992] | 4 | MODULE phyaqua_mod |
---|
| 5 | ! Routines complementaires pour la physique planetaire. |
---|
| 6 | IMPLICIT NONE |
---|
[1529] | 7 | |
---|
[1992] | 8 | CONTAINS |
---|
[1529] | 9 | |
---|
[3579] | 10 | SUBROUTINE iniaqua(nlon,year_len,iflag_phys) |
---|
[1529] | 11 | |
---|
[1992] | 12 | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
| 13 | ! Creation d'un etat initial et de conditions aux limites |
---|
| 14 | ! (resp startphy.nc et limit.nc) pour des configurations idealisees |
---|
| 15 | ! du modele LMDZ dans sa version terrestre. |
---|
| 16 | ! iflag_phys est un parametre qui controle |
---|
| 17 | ! iflag_phys = N |
---|
| 18 | ! de 100 a 199 : aqua planetes avec SST forcees |
---|
| 19 | ! N-100 determine le type de SSTs |
---|
| 20 | ! de 200 a 299 : terra planetes avec Ts calcule |
---|
[1529] | 21 | |
---|
[1992] | 22 | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
[1529] | 23 | |
---|
[1992] | 24 | USE dimphy, ONLY: klon |
---|
[2351] | 25 | USE geometry_mod, ONLY : latitude |
---|
[1992] | 26 | USE surface_data, ONLY: type_ocean, ok_veget |
---|
| 27 | USE pbl_surface_mod, ONLY: pbl_surface_init |
---|
| 28 | USE fonte_neige_mod, ONLY: fonte_neige_init |
---|
| 29 | USE phys_state_var_mod |
---|
[2344] | 30 | USE time_phylmdz_mod, ONLY: day_ref, ndays, pdtphys, & |
---|
| 31 | day_ini,day_end |
---|
[1992] | 32 | USE indice_sol_mod |
---|
[2344] | 33 | USE nrtype, ONLY: pi |
---|
[3435] | 34 | ! USE ioipsl |
---|
| 35 | USE mod_phys_lmdz_para, ONLY: is_master |
---|
| 36 | USE mod_phys_lmdz_transfert_para, ONLY: bcast |
---|
| 37 | USE mod_grid_phy_lmdz |
---|
| 38 | USE ioipsl_getin_p_mod, ONLY : getin_p |
---|
[3579] | 39 | USE phys_cal_mod , ONLY: calend, year_len_phy => year_len |
---|
[1992] | 40 | IMPLICIT NONE |
---|
[1529] | 41 | |
---|
[2344] | 42 | include "YOMCST.h" |
---|
[1992] | 43 | include "clesphys.h" |
---|
| 44 | include "dimsoil.h" |
---|
[1671] | 45 | |
---|
[3579] | 46 | INTEGER, INTENT (IN) :: nlon, year_len, iflag_phys |
---|
[1992] | 47 | ! IM ajout latfi, lonfi |
---|
[2351] | 48 | ! REAL, INTENT (IN) :: lonfi(nlon), latfi(nlon) |
---|
[1529] | 49 | |
---|
[1992] | 50 | INTEGER type_profil, type_aqua |
---|
[1529] | 51 | |
---|
[1992] | 52 | ! Ajouts initialisation des surfaces |
---|
| 53 | REAL :: run_off_lic_0(nlon) |
---|
| 54 | REAL :: qsolsrf(nlon, nbsrf), snsrf(nlon, nbsrf) |
---|
| 55 | REAL :: tsoil(nlon, nsoilmx, nbsrf) |
---|
| 56 | REAL :: tslab(nlon), seaice(nlon) |
---|
[2243] | 57 | REAL fder(nlon) |
---|
[1529] | 58 | |
---|
| 59 | |
---|
| 60 | |
---|
[1992] | 61 | ! Arguments : |
---|
| 62 | ! ----------- |
---|
[1529] | 63 | |
---|
[1992] | 64 | ! integer radpas |
---|
| 65 | INTEGER it, unit, i, k, itap |
---|
[1529] | 66 | |
---|
[1992] | 67 | REAL rugos, albedo |
---|
| 68 | REAL tsurf |
---|
| 69 | REAL time, timestep, day, day0 |
---|
[2243] | 70 | REAL qsol_f |
---|
[1992] | 71 | REAL rugsrel(nlon) |
---|
| 72 | LOGICAL alb_ocean |
---|
[1529] | 73 | |
---|
[1992] | 74 | CHARACTER *80 ans, file_forctl, file_fordat, file_start |
---|
| 75 | CHARACTER *100 file, var |
---|
| 76 | CHARACTER *2 cnbl |
---|
[1529] | 77 | |
---|
[3540] | 78 | REAL phy_nat(nlon, year_len) |
---|
| 79 | REAL phy_alb(nlon, year_len) |
---|
| 80 | REAL phy_sst(nlon, year_len) |
---|
| 81 | REAL phy_bil(nlon, year_len) |
---|
| 82 | REAL phy_rug(nlon, year_len) |
---|
| 83 | REAL phy_ice(nlon, year_len) |
---|
| 84 | REAL phy_fter(nlon, year_len) |
---|
| 85 | REAL phy_foce(nlon, year_len) |
---|
| 86 | REAL phy_fsic(nlon, year_len) |
---|
| 87 | REAL phy_flic(nlon, year_len) |
---|
[1529] | 88 | |
---|
[1992] | 89 | INTEGER, SAVE :: read_climoz = 0 ! read ozone climatology |
---|
[3435] | 90 | !$OMP THREADPRIVATE(read_climoz) |
---|
[1529] | 91 | |
---|
[1992] | 92 | ! ------------------------------------------------------------------------- |
---|
| 93 | ! declaration pour l'appel a phyredem |
---|
| 94 | ! ------------------------------------------------------------------------- |
---|
[1529] | 95 | |
---|
[1992] | 96 | ! real pctsrf(nlon,nbsrf),ftsol(nlon,nbsrf) |
---|
| 97 | REAL falbe(nlon, nbsrf), falblw(nlon, nbsrf) |
---|
| 98 | ! real pbl_tke(nlon,llm,nbsrf) |
---|
| 99 | ! real rain_fall(nlon),snow_fall(nlon) |
---|
| 100 | ! real solsw(nlon), sollw(nlon),radsol(nlon) |
---|
| 101 | ! real t_ancien(nlon,llm),q_ancien(nlon,llm),rnebcon(nlon,llm) |
---|
| 102 | ! real ratqs(nlon,llm) |
---|
| 103 | ! real clwcon(nlon,llm) |
---|
[1529] | 104 | |
---|
[1992] | 105 | INTEGER longcles |
---|
| 106 | PARAMETER (longcles=20) |
---|
| 107 | REAL clesphy0(longcles) |
---|
[1529] | 108 | |
---|
| 109 | |
---|
[1992] | 110 | ! ----------------------------------------------------------------------- |
---|
| 111 | ! dynamial tendencies : |
---|
| 112 | ! --------------------- |
---|
[1529] | 113 | |
---|
[1992] | 114 | INTEGER l, ierr, aslun |
---|
[1529] | 115 | |
---|
[1992] | 116 | REAL paire |
---|
[1529] | 117 | |
---|
[3531] | 118 | ! Local |
---|
| 119 | CHARACTER (LEN=20) :: modname='phyaqua' |
---|
| 120 | CHARACTER (LEN=80) :: abort_message |
---|
[1529] | 121 | |
---|
[3531] | 122 | |
---|
[1992] | 123 | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
| 124 | ! INITIALISATIONS |
---|
| 125 | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
[1529] | 126 | |
---|
[1992] | 127 | ! ----------------------------------------------------------------------- |
---|
| 128 | ! Initialisations des constantes |
---|
| 129 | ! ------------------------------- |
---|
[1529] | 130 | |
---|
[3579] | 131 | !IF (calend .EQ. "earth_360d") Then |
---|
| 132 | year_len_phy = year_len |
---|
| 133 | !END IF |
---|
| 134 | |
---|
[3540] | 135 | if (year_len.ne.360) then |
---|
[3579] | 136 | write (*,*) year_len |
---|
[3540] | 137 | write (*,*) 'iniaqua: 360 day calendar is required !' |
---|
| 138 | stop |
---|
| 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. |
---|
| 363 | u_ancien = 0. |
---|
| 364 | v_ancien = 0. |
---|
| 365 | prw_ancien = 0. |
---|
| 366 | prlw_ancien = 0. |
---|
| 367 | prsw_ancien = 0. |
---|
| 368 | |
---|
| 369 | ale_wake = 0. |
---|
| 370 | ale_bl_stat = 0. |
---|
| 371 | |
---|
| 372 | |
---|
[3435] | 373 | !ym error : the sub surface dimension is the third not second : forgotten for iniaqua |
---|
| 374 | ! falb_dir(:,is_ter,:)=0.08; falb_dir(:,is_lic,:)=0.6 |
---|
| 375 | ! falb_dir(:,is_oce,:)=0.5; falb_dir(:,is_sic,:)=0.6 |
---|
| 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 |
---|
[1529] | 378 | |
---|
[3435] | 379 | !ym falb_dif has been forgotten, initialize with defaukt value found in phyetat0 or 0 ? |
---|
| 380 | !ym probably the uninitialized value was 0 for standard (regular grid) case |
---|
| 381 | falb_dif(:,:,:)=0 |
---|
| 382 | |
---|
| 383 | |
---|
[1992] | 384 | CALL phyredem('startphy.nc') |
---|
[1529] | 385 | |
---|
[1992] | 386 | PRINT *, 'iniaqua: after phyredem' |
---|
| 387 | CALL phys_state_var_end |
---|
[1529] | 388 | |
---|
[1992] | 389 | RETURN |
---|
| 390 | END SUBROUTINE iniaqua |
---|
[1529] | 391 | |
---|
| 392 | |
---|
[1992] | 393 | ! ==================================================================== |
---|
| 394 | ! ==================================================================== |
---|
| 395 | SUBROUTINE zenang_an(cycle_diurne, gmtime, rlat, rlon, rmu0, fract) |
---|
| 396 | USE dimphy |
---|
| 397 | IMPLICIT NONE |
---|
| 398 | ! ==================================================================== |
---|
| 399 | ! ============================================================= |
---|
| 400 | ! CALL zenang(cycle_diurne,gmtime,rlat,rlon,rmu0,fract) |
---|
| 401 | ! Auteur : A. Campoy et F. Hourdin |
---|
| 402 | ! Objet : calculer les valeurs moyennes du cos de l'angle zenithal |
---|
| 403 | ! et l'ensoleillement moyen entre gmtime1 et gmtime2 |
---|
| 404 | ! connaissant la declinaison, la latitude et la longitude. |
---|
[1529] | 405 | |
---|
[1992] | 406 | ! Dans cette version particuliere, on calcule le rayonnement |
---|
| 407 | ! moyen sur l'année à chaque latitude. |
---|
| 408 | ! angle zenithal calculé pour obtenir un |
---|
| 409 | ! Fit polynomial de l'ensoleillement moyen au sommet de l'atmosphere |
---|
| 410 | ! en moyenne annuelle. |
---|
| 411 | ! Spécifique de la terre. Utilisé pour les aqua planetes. |
---|
[1529] | 412 | |
---|
[1992] | 413 | ! Rque : Different de la routine angle en ce sens que zenang |
---|
| 414 | ! fournit des moyennes de pmu0 et non des valeurs |
---|
| 415 | ! instantanees, du coup frac prend toutes les valeurs |
---|
| 416 | ! entre 0 et 1. |
---|
| 417 | ! Date : premiere version le 13 decembre 1994 |
---|
| 418 | ! revu pour GCM le 30 septembre 1996 |
---|
| 419 | ! =============================================================== |
---|
| 420 | ! longi----INPUT : la longitude vraie de la terre dans son plan |
---|
| 421 | ! solaire a partir de l'equinoxe de printemps (degre) |
---|
| 422 | ! gmtime---INPUT : temps universel en fraction de jour |
---|
| 423 | ! pdtrad---INPUT : pas de temps du rayonnement (secondes) |
---|
| 424 | ! lat------INPUT : latitude en degres |
---|
| 425 | ! long-----INPUT : longitude en degres |
---|
| 426 | ! pmu0-----OUTPUT: angle zenithal moyen entre gmtime et gmtime+pdtrad |
---|
| 427 | ! frac-----OUTPUT: ensoleillement moyen entre gmtime et gmtime+pdtrad |
---|
| 428 | ! ================================================================ |
---|
| 429 | include "YOMCST.h" |
---|
| 430 | ! ================================================================ |
---|
| 431 | LOGICAL cycle_diurne |
---|
| 432 | REAL gmtime |
---|
| 433 | REAL rlat(klon), rlon(klon), rmu0(klon), fract(klon) |
---|
| 434 | ! ================================================================ |
---|
| 435 | INTEGER i |
---|
| 436 | REAL gmtime1, gmtime2 |
---|
| 437 | REAL pi_local |
---|
[1529] | 438 | |
---|
| 439 | |
---|
[1992] | 440 | REAL rmu0m(klon), rmu0a(klon) |
---|
[1529] | 441 | |
---|
| 442 | |
---|
[1992] | 443 | pi_local = 4.0*atan(1.0) |
---|
[1529] | 444 | |
---|
[1992] | 445 | ! ================================================================ |
---|
| 446 | ! Calcul de l'angle zenithal moyen sur la journee |
---|
| 447 | ! ================================================================ |
---|
| 448 | |
---|
| 449 | DO i = 1, klon |
---|
| 450 | fract(i) = 1. |
---|
| 451 | ! Calcule du flux moyen |
---|
| 452 | IF (abs(rlat(i))<=28.75) THEN |
---|
| 453 | rmu0m(i) = (210.1924+206.6059*cos(0.0174533*rlat(i))**2)/1365. |
---|
| 454 | ELSE IF (abs(rlat(i))<=43.75) THEN |
---|
| 455 | rmu0m(i) = (187.4562+236.1853*cos(0.0174533*rlat(i))**2)/1365. |
---|
| 456 | ELSE IF (abs(rlat(i))<=71.25) THEN |
---|
| 457 | rmu0m(i) = (162.4439+284.1192*cos(0.0174533*rlat(i))**2)/1365. |
---|
[1529] | 458 | ELSE |
---|
[1992] | 459 | rmu0m(i) = (172.8125+183.7673*cos(0.0174533*rlat(i))**2)/1365. |
---|
| 460 | END IF |
---|
| 461 | END DO |
---|
[1529] | 462 | |
---|
[1992] | 463 | ! ================================================================ |
---|
| 464 | ! Avec ou sans cycle diurne |
---|
| 465 | ! ================================================================ |
---|
[1529] | 466 | |
---|
[1992] | 467 | IF (cycle_diurne) THEN |
---|
[1529] | 468 | |
---|
[1992] | 469 | ! On redecompose flux au sommet suivant un cycle diurne idealise |
---|
| 470 | ! identique a toutes les latitudes. |
---|
[1671] | 471 | |
---|
[1992] | 472 | DO i = 1, klon |
---|
| 473 | rmu0a(i) = 2.*rmu0m(i)*sqrt(2.)*pi_local/(4.-pi_local) |
---|
| 474 | rmu0(i) = rmu0a(i)*abs(sin(pi_local*gmtime+pi_local*rlon(i)/360.)) - & |
---|
| 475 | rmu0a(i)/sqrt(2.) |
---|
| 476 | END DO |
---|
[1671] | 477 | |
---|
[1992] | 478 | DO i = 1, klon |
---|
| 479 | IF (rmu0(i)<=0.) THEN |
---|
| 480 | rmu0(i) = 0. |
---|
| 481 | fract(i) = 0. |
---|
| 482 | ELSE |
---|
| 483 | fract(i) = 1. |
---|
| 484 | END IF |
---|
| 485 | END DO |
---|
[1671] | 486 | |
---|
[1992] | 487 | ! Affichage de l'angel zenitale |
---|
| 488 | ! print*,'************************************' |
---|
| 489 | ! print*,'************************************' |
---|
| 490 | ! print*,'************************************' |
---|
| 491 | ! print*,'latitude=',rlat(i),'longitude=',rlon(i) |
---|
| 492 | ! print*,'rmu0m=',rmu0m(i) |
---|
| 493 | ! print*,'rmu0a=',rmu0a(i) |
---|
| 494 | ! print*,'rmu0=',rmu0(i) |
---|
[1529] | 495 | |
---|
[1992] | 496 | ELSE |
---|
[1671] | 497 | |
---|
[1992] | 498 | DO i = 1, klon |
---|
| 499 | fract(i) = 0.5 |
---|
| 500 | rmu0(i) = rmu0m(i)*2. |
---|
| 501 | END DO |
---|
| 502 | |
---|
| 503 | END IF |
---|
| 504 | |
---|
| 505 | RETURN |
---|
| 506 | END SUBROUTINE zenang_an |
---|
| 507 | |
---|
| 508 | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
| 509 | |
---|
[3435] | 510 | SUBROUTINE writelim_unstruct(klon, phy_nat, phy_alb, phy_sst, phy_bil, phy_rug, & |
---|
| 511 | phy_ice, phy_fter, phy_foce, phy_flic, phy_fsic) |
---|
| 512 | |
---|
| 513 | USE mod_phys_lmdz_para, ONLY: is_omp_master, klon_mpi |
---|
| 514 | USE mod_phys_lmdz_transfert_para, ONLY: gather_omp |
---|
| 515 | #ifdef CPP_XIOS |
---|
| 516 | USE xios |
---|
| 517 | #endif |
---|
| 518 | IMPLICIT NONE |
---|
| 519 | |
---|
| 520 | include "netcdf.inc" |
---|
| 521 | |
---|
| 522 | INTEGER, INTENT (IN) :: klon |
---|
| 523 | REAL, INTENT (IN) :: phy_nat(klon, 360) |
---|
| 524 | REAL, INTENT (IN) :: phy_alb(klon, 360) |
---|
| 525 | REAL, INTENT (IN) :: phy_sst(klon, 360) |
---|
| 526 | REAL, INTENT (IN) :: phy_bil(klon, 360) |
---|
| 527 | REAL, INTENT (IN) :: phy_rug(klon, 360) |
---|
| 528 | REAL, INTENT (IN) :: phy_ice(klon, 360) |
---|
| 529 | REAL, INTENT (IN) :: phy_fter(klon, 360) |
---|
| 530 | REAL, INTENT (IN) :: phy_foce(klon, 360) |
---|
| 531 | REAL, INTENT (IN) :: phy_flic(klon, 360) |
---|
| 532 | REAL, INTENT (IN) :: phy_fsic(klon, 360) |
---|
| 533 | |
---|
| 534 | REAL :: phy_mpi(klon_mpi, 360) ! temporary variable, to store phy_***(:) |
---|
| 535 | ! on the whole physics grid |
---|
| 536 | |
---|
| 537 | #ifdef CPP_XIOS |
---|
| 538 | PRINT *, 'writelim: Ecriture du fichier limit' |
---|
| 539 | |
---|
| 540 | CALL gather_omp(phy_foce, phy_mpi) |
---|
| 541 | IF (is_omp_master) CALL xios_send_field('foce_limout',phy_mpi) |
---|
| 542 | |
---|
| 543 | CALL gather_omp(phy_fsic, phy_mpi) |
---|
| 544 | IF (is_omp_master) CALL xios_send_field('fsic_limout',phy_mpi) |
---|
| 545 | |
---|
| 546 | CALL gather_omp(phy_fter, phy_mpi) |
---|
| 547 | IF (is_omp_master) CALL xios_send_field('fter_limout',phy_mpi) |
---|
| 548 | |
---|
| 549 | CALL gather_omp(phy_flic, phy_mpi) |
---|
| 550 | IF (is_omp_master) CALL xios_send_field('flic_limout',phy_mpi) |
---|
| 551 | |
---|
| 552 | CALL gather_omp(phy_sst, phy_mpi) |
---|
| 553 | IF (is_omp_master) CALL xios_send_field('sst_limout',phy_mpi) |
---|
| 554 | |
---|
| 555 | CALL gather_omp(phy_bil, phy_mpi) |
---|
| 556 | IF (is_omp_master) CALL xios_send_field('bils_limout',phy_mpi) |
---|
| 557 | |
---|
| 558 | CALL gather_omp(phy_alb, phy_mpi) |
---|
| 559 | IF (is_omp_master) CALL xios_send_field('alb_limout',phy_mpi) |
---|
| 560 | |
---|
| 561 | CALL gather_omp(phy_rug, phy_mpi) |
---|
| 562 | IF (is_omp_master) CALL xios_send_field('rug_limout',phy_mpi) |
---|
| 563 | #endif |
---|
| 564 | END SUBROUTINE writelim_unstruct |
---|
| 565 | |
---|
| 566 | |
---|
| 567 | |
---|
[1992] | 568 | SUBROUTINE writelim(klon, phy_nat, phy_alb, phy_sst, phy_bil, phy_rug, & |
---|
| 569 | phy_ice, phy_fter, phy_foce, phy_flic, phy_fsic) |
---|
| 570 | |
---|
[3435] | 571 | USE mod_phys_lmdz_para, ONLY: is_master |
---|
[1992] | 572 | USE mod_grid_phy_lmdz, ONLY: klon_glo |
---|
| 573 | USE mod_phys_lmdz_transfert_para, ONLY: gather |
---|
[3540] | 574 | USE phys_cal_mod, ONLY: year_len |
---|
[4253] | 575 | use netcdf, only: nf90_def_var, nf90_double, nf90_float |
---|
[1992] | 576 | IMPLICIT NONE |
---|
| 577 | include "netcdf.inc" |
---|
| 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 | |
---|
[3401] | 608 | ierr = nf_create('limit.nc', IOR(NF_CLOBBER,NF_64BIT_OFFSET), nid) |
---|
[1992] | 609 | |
---|
| 610 | ierr = nf_put_att_text(nid, nf_global, 'title', 30, & |
---|
| 611 | 'Fichier conditions aux limites') |
---|
| 612 | ! ! ierr = NF_DEF_DIM (nid, "points_physiques", klon, ndim) |
---|
| 613 | ierr = nf_def_dim(nid, 'points_physiques', klon_glo, ndim) |
---|
| 614 | ierr = nf_def_dim(nid, 'time', nf_unlimited, ntim) |
---|
| 615 | |
---|
| 616 | dims(1) = ndim |
---|
| 617 | dims(2) = ntim |
---|
| 618 | |
---|
[2198] | 619 | #ifdef NC_DOUBLE |
---|
[4253] | 620 | ierr = nf90_def_var(nid, 'TEMPS', nf90_double, [ntim], id_tim) |
---|
[2198] | 621 | #else |
---|
[4253] | 622 | ierr = nf90_def_var(nid, 'TEMPS', nf90_float, [ntim], id_tim) |
---|
[2198] | 623 | #endif |
---|
[1992] | 624 | ierr = nf_put_att_text(nid, id_tim, 'title', 17, 'Jour dans l annee') |
---|
[2198] | 625 | |
---|
| 626 | #ifdef NC_DOUBLE |
---|
[4253] | 627 | ierr = nf90_def_var(nid, 'NAT', nf90_double, dims, id_nat) |
---|
[2198] | 628 | #else |
---|
[4253] | 629 | ierr = nf90_def_var(nid, 'NAT', nf90_float, dims, id_nat) |
---|
[2198] | 630 | #endif |
---|
[1992] | 631 | ierr = nf_put_att_text(nid, id_nat, 'title', 23, & |
---|
| 632 | 'Nature du sol (0,1,2,3)') |
---|
[2198] | 633 | |
---|
| 634 | #ifdef NC_DOUBLE |
---|
[4253] | 635 | ierr = nf90_def_var(nid, 'SST', nf90_double, dims, id_sst) |
---|
[2198] | 636 | #else |
---|
[4253] | 637 | ierr = nf90_def_var(nid, 'SST', nf90_float, dims, id_sst) |
---|
[2198] | 638 | #endif |
---|
[1992] | 639 | ierr = nf_put_att_text(nid, id_sst, 'title', 35, & |
---|
| 640 | 'Temperature superficielle de la mer') |
---|
[2198] | 641 | |
---|
| 642 | #ifdef NC_DOUBLE |
---|
[4253] | 643 | ierr = nf90_def_var(nid, 'BILS', nf90_double, dims, id_bils) |
---|
[2198] | 644 | #else |
---|
[4253] | 645 | ierr = nf90_def_var(nid, 'BILS', nf90_float, dims, id_bils) |
---|
[2198] | 646 | #endif |
---|
[1992] | 647 | ierr = nf_put_att_text(nid, id_bils, 'title', 32, & |
---|
| 648 | 'Reference flux de chaleur au sol') |
---|
[2198] | 649 | |
---|
| 650 | #ifdef NC_DOUBLE |
---|
[4253] | 651 | ierr = nf90_def_var(nid, 'ALB', nf90_double, dims, id_alb) |
---|
[2198] | 652 | #else |
---|
[4253] | 653 | ierr = nf90_def_var(nid, 'ALB', nf90_float, dims, id_alb) |
---|
[2198] | 654 | #endif |
---|
[1992] | 655 | ierr = nf_put_att_text(nid, id_alb, 'title', 19, 'Albedo a la surface') |
---|
[2198] | 656 | |
---|
| 657 | #ifdef NC_DOUBLE |
---|
[4253] | 658 | ierr = nf90_def_var(nid, 'RUG', nf90_double, dims, id_rug) |
---|
[2198] | 659 | #else |
---|
[4253] | 660 | ierr = nf90_def_var(nid, 'RUG', nf90_float, dims, id_rug) |
---|
[2198] | 661 | #endif |
---|
[1992] | 662 | ierr = nf_put_att_text(nid, id_rug, 'title', 8, 'Rugosite') |
---|
| 663 | |
---|
[2198] | 664 | #ifdef NC_DOUBLE |
---|
[4253] | 665 | ierr = nf90_def_var(nid, 'FTER', nf90_double, dims, id_fter) |
---|
[2198] | 666 | #else |
---|
[4253] | 667 | ierr = nf90_def_var(nid, 'FTER', nf90_float, dims, id_fter) |
---|
[2198] | 668 | #endif |
---|
| 669 | ierr = nf_put_att_text(nid, id_fter, 'title',10,'Frac. Land') |
---|
| 670 | #ifdef NC_DOUBLE |
---|
[4253] | 671 | ierr = nf90_def_var(nid, 'FOCE', nf90_double, dims, id_foce) |
---|
[2198] | 672 | #else |
---|
[4253] | 673 | ierr = nf90_def_var(nid, 'FOCE', nf90_float, dims, id_foce) |
---|
[2198] | 674 | #endif |
---|
| 675 | ierr = nf_put_att_text(nid, id_foce, 'title',11,'Frac. Ocean') |
---|
| 676 | #ifdef NC_DOUBLE |
---|
[4253] | 677 | ierr = nf90_def_var(nid, 'FSIC', nf90_double, dims, id_fsic) |
---|
[2198] | 678 | #else |
---|
[4253] | 679 | ierr = nf90_def_var(nid, 'FSIC', nf90_float, dims, id_fsic) |
---|
[2198] | 680 | #endif |
---|
| 681 | ierr = nf_put_att_text(nid, id_fsic, 'title',13,'Frac. Sea Ice') |
---|
| 682 | #ifdef NC_DOUBLE |
---|
[4253] | 683 | ierr = nf90_def_var(nid, 'FLIC', nf90_double, dims, id_flic) |
---|
[2198] | 684 | #else |
---|
[4253] | 685 | ierr = nf90_def_var(nid, 'FLIC', nf90_float, dims, id_flic) |
---|
[2198] | 686 | #endif |
---|
| 687 | ierr = nf_put_att_text(nid, id_flic, 'title',14,'Frac. Land Ice') |
---|
[1992] | 688 | |
---|
| 689 | ierr = nf_enddef(nid) |
---|
| 690 | IF (ierr/=nf_noerr) THEN |
---|
| 691 | WRITE (*, *) 'writelim error: failed to end define mode' |
---|
| 692 | WRITE (*, *) nf_strerror(ierr) |
---|
| 693 | END IF |
---|
| 694 | |
---|
| 695 | |
---|
| 696 | ! write the 'times' |
---|
[3540] | 697 | DO k = 1, year_len |
---|
[1529] | 698 | #ifdef NC_DOUBLE |
---|
[1992] | 699 | ierr = nf_put_var1_double(nid, id_tim, k, dble(k)) |
---|
[1529] | 700 | #else |
---|
[1992] | 701 | ierr = nf_put_var1_real(nid, id_tim, k, float(k)) |
---|
[1671] | 702 | #endif |
---|
[1992] | 703 | IF (ierr/=nf_noerr) THEN |
---|
| 704 | WRITE (*, *) 'writelim error with temps(k),k=', k |
---|
| 705 | WRITE (*, *) nf_strerror(ierr) |
---|
| 706 | END IF |
---|
| 707 | END DO |
---|
[1529] | 708 | |
---|
[3435] | 709 | END IF ! of if (is_master) |
---|
[1671] | 710 | |
---|
[1992] | 711 | ! write the fields, after having collected them on master |
---|
[1671] | 712 | |
---|
[1992] | 713 | CALL gather(phy_nat, phy_glo) |
---|
[3435] | 714 | IF (is_master) THEN |
---|
[1671] | 715 | #ifdef NC_DOUBLE |
---|
[1992] | 716 | ierr = nf_put_var_double(nid, id_nat, phy_glo) |
---|
[1671] | 717 | #else |
---|
[1992] | 718 | ierr = nf_put_var_real(nid, id_nat, phy_glo) |
---|
[1529] | 719 | #endif |
---|
[1992] | 720 | IF (ierr/=nf_noerr) THEN |
---|
| 721 | WRITE (*, *) 'writelim error with phy_nat' |
---|
| 722 | WRITE (*, *) nf_strerror(ierr) |
---|
| 723 | END IF |
---|
| 724 | END IF |
---|
[1671] | 725 | |
---|
[1992] | 726 | CALL gather(phy_sst, phy_glo) |
---|
[3435] | 727 | IF (is_master) THEN |
---|
[1671] | 728 | #ifdef NC_DOUBLE |
---|
[1992] | 729 | ierr = nf_put_var_double(nid, id_sst, phy_glo) |
---|
[1671] | 730 | #else |
---|
[1992] | 731 | ierr = nf_put_var_real(nid, id_sst, phy_glo) |
---|
[1671] | 732 | #endif |
---|
[1992] | 733 | IF (ierr/=nf_noerr) THEN |
---|
| 734 | WRITE (*, *) 'writelim error with phy_sst' |
---|
| 735 | WRITE (*, *) nf_strerror(ierr) |
---|
| 736 | END IF |
---|
| 737 | END IF |
---|
[1671] | 738 | |
---|
[1992] | 739 | CALL gather(phy_bil, phy_glo) |
---|
[3435] | 740 | IF (is_master) THEN |
---|
[1671] | 741 | #ifdef NC_DOUBLE |
---|
[1992] | 742 | ierr = nf_put_var_double(nid, id_bils, phy_glo) |
---|
[1671] | 743 | #else |
---|
[1992] | 744 | ierr = nf_put_var_real(nid, id_bils, phy_glo) |
---|
[1671] | 745 | #endif |
---|
[1992] | 746 | IF (ierr/=nf_noerr) THEN |
---|
| 747 | WRITE (*, *) 'writelim error with phy_bil' |
---|
| 748 | WRITE (*, *) nf_strerror(ierr) |
---|
| 749 | END IF |
---|
| 750 | END IF |
---|
[1671] | 751 | |
---|
[1992] | 752 | CALL gather(phy_alb, phy_glo) |
---|
[3435] | 753 | IF (is_master) THEN |
---|
[1671] | 754 | #ifdef NC_DOUBLE |
---|
[1992] | 755 | ierr = nf_put_var_double(nid, id_alb, phy_glo) |
---|
[1671] | 756 | #else |
---|
[1992] | 757 | ierr = nf_put_var_real(nid, id_alb, phy_glo) |
---|
[1671] | 758 | #endif |
---|
[1992] | 759 | IF (ierr/=nf_noerr) THEN |
---|
| 760 | WRITE (*, *) 'writelim error with phy_alb' |
---|
| 761 | WRITE (*, *) nf_strerror(ierr) |
---|
| 762 | END IF |
---|
| 763 | END IF |
---|
[1671] | 764 | |
---|
[1992] | 765 | CALL gather(phy_rug, phy_glo) |
---|
[3435] | 766 | IF (is_master) THEN |
---|
[1671] | 767 | #ifdef NC_DOUBLE |
---|
[1992] | 768 | ierr = nf_put_var_double(nid, id_rug, phy_glo) |
---|
[1671] | 769 | #else |
---|
[1992] | 770 | ierr = nf_put_var_real(nid, id_rug, phy_glo) |
---|
[1671] | 771 | #endif |
---|
[1992] | 772 | IF (ierr/=nf_noerr) THEN |
---|
| 773 | WRITE (*, *) 'writelim error with phy_rug' |
---|
| 774 | WRITE (*, *) nf_strerror(ierr) |
---|
| 775 | END IF |
---|
| 776 | END IF |
---|
[1671] | 777 | |
---|
[1992] | 778 | CALL gather(phy_fter, phy_glo) |
---|
[3435] | 779 | IF (is_master) THEN |
---|
[1671] | 780 | #ifdef NC_DOUBLE |
---|
[1992] | 781 | ierr = nf_put_var_double(nid, id_fter, phy_glo) |
---|
[1671] | 782 | #else |
---|
[1992] | 783 | ierr = nf_put_var_real(nid, id_fter, phy_glo) |
---|
[1671] | 784 | #endif |
---|
[1992] | 785 | IF (ierr/=nf_noerr) THEN |
---|
| 786 | WRITE (*, *) 'writelim error with phy_fter' |
---|
| 787 | WRITE (*, *) nf_strerror(ierr) |
---|
| 788 | END IF |
---|
| 789 | END IF |
---|
[1671] | 790 | |
---|
[1992] | 791 | CALL gather(phy_foce, phy_glo) |
---|
[3435] | 792 | IF (is_master) THEN |
---|
[1671] | 793 | #ifdef NC_DOUBLE |
---|
[1992] | 794 | ierr = nf_put_var_double(nid, id_foce, phy_glo) |
---|
[1671] | 795 | #else |
---|
[1992] | 796 | ierr = nf_put_var_real(nid, id_foce, phy_glo) |
---|
[1671] | 797 | #endif |
---|
[1992] | 798 | IF (ierr/=nf_noerr) THEN |
---|
| 799 | WRITE (*, *) 'writelim error with phy_foce' |
---|
| 800 | WRITE (*, *) nf_strerror(ierr) |
---|
| 801 | END IF |
---|
| 802 | END IF |
---|
[1671] | 803 | |
---|
[1992] | 804 | CALL gather(phy_fsic, phy_glo) |
---|
[3435] | 805 | IF (is_master) THEN |
---|
[1671] | 806 | #ifdef NC_DOUBLE |
---|
[1992] | 807 | ierr = nf_put_var_double(nid, id_fsic, phy_glo) |
---|
[1671] | 808 | #else |
---|
[1992] | 809 | ierr = nf_put_var_real(nid, id_fsic, phy_glo) |
---|
[1671] | 810 | #endif |
---|
[1992] | 811 | IF (ierr/=nf_noerr) THEN |
---|
| 812 | WRITE (*, *) 'writelim error with phy_fsic' |
---|
| 813 | WRITE (*, *) nf_strerror(ierr) |
---|
| 814 | END IF |
---|
| 815 | END IF |
---|
[1671] | 816 | |
---|
[1992] | 817 | CALL gather(phy_flic, phy_glo) |
---|
[3435] | 818 | IF (is_master) THEN |
---|
[1671] | 819 | #ifdef NC_DOUBLE |
---|
[1992] | 820 | ierr = nf_put_var_double(nid, id_flic, phy_glo) |
---|
[1671] | 821 | #else |
---|
[1992] | 822 | ierr = nf_put_var_real(nid, id_flic, phy_glo) |
---|
[1671] | 823 | #endif |
---|
[1992] | 824 | IF (ierr/=nf_noerr) THEN |
---|
| 825 | WRITE (*, *) 'writelim error with phy_flic' |
---|
| 826 | WRITE (*, *) nf_strerror(ierr) |
---|
| 827 | END IF |
---|
| 828 | END IF |
---|
[1671] | 829 | |
---|
[1992] | 830 | ! close file: |
---|
[3435] | 831 | IF (is_master) THEN |
---|
[1992] | 832 | ierr = nf_close(nid) |
---|
| 833 | END IF |
---|
[1671] | 834 | |
---|
[1992] | 835 | END SUBROUTINE writelim |
---|
[1529] | 836 | |
---|
[1992] | 837 | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
[1671] | 838 | |
---|
[1992] | 839 | SUBROUTINE profil_sst(nlon, rlatd, type_profil, phy_sst) |
---|
| 840 | USE dimphy |
---|
[3540] | 841 | USE phys_cal_mod , ONLY: year_len |
---|
[1992] | 842 | IMPLICIT NONE |
---|
[1529] | 843 | |
---|
[1992] | 844 | INTEGER nlon, type_profil, i, k, j |
---|
[3540] | 845 | REAL :: rlatd(nlon), phy_sst(nlon, year_len) |
---|
[1992] | 846 | INTEGER imn, imx, amn, amx, kmn, kmx |
---|
| 847 | INTEGER p, pplus, nlat_max |
---|
| 848 | PARAMETER (nlat_max=72) |
---|
| 849 | REAL x_anom_sst(nlat_max) |
---|
[3531] | 850 | CHARACTER (LEN=20) :: modname='profil_sst' |
---|
| 851 | CHARACTER (LEN=80) :: abort_message |
---|
[1529] | 852 | |
---|
[3531] | 853 | IF (klon/=nlon) THEN |
---|
| 854 | abort_message='probleme de dimensions dans profil_sst' |
---|
| 855 | CALL abort_physic(modname,abort_message,1) |
---|
| 856 | ENDIF |
---|
[1992] | 857 | WRITE (*, *) ' profil_sst: type_profil=', type_profil |
---|
[3540] | 858 | DO i = 1, year_len |
---|
[1992] | 859 | ! phy_sst(:,i) = 260.+50.*cos(rlatd(:))**2 |
---|
[1529] | 860 | |
---|
[1992] | 861 | ! Rajout fbrlmd |
---|
[1529] | 862 | |
---|
[1992] | 863 | IF (type_profil==1) THEN |
---|
| 864 | ! Méthode 1 "Control" faible plateau à l'Equateur |
---|
| 865 | DO j = 1, klon |
---|
| 866 | phy_sst(j, i) = 273. + 27.*(1-sin(1.5*rlatd(j))**2) |
---|
| 867 | ! PI/3=1.047197551 |
---|
| 868 | IF ((rlatd(j)>1.0471975) .OR. (rlatd(j)<-1.0471975)) THEN |
---|
| 869 | phy_sst(j, i) = 273. |
---|
| 870 | END IF |
---|
| 871 | END DO |
---|
| 872 | END IF |
---|
| 873 | IF (type_profil==2) THEN |
---|
| 874 | ! Méthode 2 "Flat" fort plateau à l'Equateur |
---|
| 875 | DO j = 1, klon |
---|
| 876 | phy_sst(j, i) = 273. + 27.*(1-sin(1.5*rlatd(j))**4) |
---|
| 877 | IF ((rlatd(j)>1.0471975) .OR. (rlatd(j)<-1.0471975)) THEN |
---|
| 878 | phy_sst(j, i) = 273. |
---|
| 879 | END IF |
---|
| 880 | END DO |
---|
| 881 | END IF |
---|
[1529] | 882 | |
---|
| 883 | |
---|
[1992] | 884 | IF (type_profil==3) THEN |
---|
| 885 | ! Méthode 3 "Qobs" plateau réel à l'Equateur |
---|
| 886 | DO j = 1, klon |
---|
| 887 | phy_sst(j, i) = 273. + 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. |
---|
| 891 | END IF |
---|
| 892 | END DO |
---|
| 893 | END IF |
---|
[1529] | 894 | |
---|
[1992] | 895 | IF (type_profil==4) THEN |
---|
| 896 | ! Méthode 4 : Méthode 3 + SST+2 "Qobs" plateau réel à l'Equateur |
---|
| 897 | DO j = 1, klon |
---|
| 898 | phy_sst(j, i) = 273. + 0.5*29.*(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==5) THEN |
---|
| 907 | ! Méthode 5 : Méthode 3 + +2K "Qobs" plateau réel à l'Equateur |
---|
| 908 | DO j = 1, klon |
---|
| 909 | phy_sst(j, i) = 273. + 2. + 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. + 2. |
---|
| 913 | END IF |
---|
[1529] | 914 | |
---|
[1992] | 915 | END DO |
---|
| 916 | END IF |
---|
[1529] | 917 | |
---|
[1992] | 918 | IF (type_profil==6) THEN |
---|
| 919 | ! Méthode 6 "cst" valeur constante de SST |
---|
| 920 | DO j = 1, klon |
---|
| 921 | phy_sst(j, i) = 288. |
---|
| 922 | END DO |
---|
| 923 | END IF |
---|
[1529] | 924 | |
---|
| 925 | |
---|
[1992] | 926 | IF (type_profil==7) THEN |
---|
| 927 | ! Méthode 7 "cst" valeur constante de SST +2 |
---|
| 928 | DO j = 1, klon |
---|
| 929 | phy_sst(j, i) = 288. + 2. |
---|
| 930 | END DO |
---|
| 931 | END IF |
---|
[1529] | 932 | |
---|
[1992] | 933 | p = 0 |
---|
| 934 | IF (type_profil==8) THEN |
---|
| 935 | ! Méthode 8 profil anomalies SST du modèle couplé AR4 |
---|
| 936 | DO j = 1, klon |
---|
| 937 | IF (rlatd(j)==rlatd(j-1)) THEN |
---|
| 938 | phy_sst(j, i) = 273. + x_anom_sst(pplus) + & |
---|
| 939 | 0.5*27.*(2-sin(1.5*rlatd(j))**2-sin(1.5*rlatd(j))**4) |
---|
| 940 | IF ((rlatd(j)>1.0471975) .OR. (rlatd(j)<-1.0471975)) THEN |
---|
| 941 | phy_sst(j, i) = 273. + x_anom_sst(pplus) |
---|
| 942 | END IF |
---|
| 943 | ELSE |
---|
| 944 | p = p + 1 |
---|
| 945 | pplus = 73 - p |
---|
| 946 | phy_sst(j, i) = 273. + x_anom_sst(pplus) + & |
---|
| 947 | 0.5*27.*(2-sin(1.5*rlatd(j))**2-sin(1.5*rlatd(j))**4) |
---|
| 948 | IF ((rlatd(j)>1.0471975) .OR. (rlatd(j)<-1.0471975)) THEN |
---|
| 949 | phy_sst(j, i) = 273. + x_anom_sst(pplus) |
---|
| 950 | END IF |
---|
| 951 | WRITE (*, *) rlatd(j), x_anom_sst(pplus), phy_sst(j, i) |
---|
| 952 | END IF |
---|
| 953 | END DO |
---|
| 954 | END IF |
---|
[1529] | 955 | |
---|
[1992] | 956 | IF (type_profil==9) THEN |
---|
| 957 | ! Méthode 5 : Méthode 3 + -2K "Qobs" plateau réel à l'Equateur |
---|
| 958 | DO j = 1, klon |
---|
| 959 | phy_sst(j, i) = 273. - 2. + 0.5*27.*(2-sin(1.5*rlatd(j))**2-sin(1.5 & |
---|
| 960 | *rlatd(j))**4) |
---|
| 961 | IF ((rlatd(j)>1.0471975) .OR. (rlatd(j)<-1.0471975)) THEN |
---|
| 962 | phy_sst(j, i) = 273. - 2. |
---|
| 963 | END IF |
---|
| 964 | END DO |
---|
| 965 | END IF |
---|
[1529] | 966 | |
---|
| 967 | |
---|
[1992] | 968 | IF (type_profil==10) THEN |
---|
| 969 | ! Méthode 10 : Méthode 3 + +4K "Qobs" plateau réel à l'Equateur |
---|
| 970 | DO j = 1, klon |
---|
| 971 | phy_sst(j, i) = 273. + 4. + 0.5*27.*(2-sin(1.5*rlatd(j))**2-sin(1.5 & |
---|
| 972 | *rlatd(j))**4) |
---|
| 973 | IF ((rlatd(j)>1.0471975) .OR. (rlatd(j)<-1.0471975)) THEN |
---|
| 974 | phy_sst(j, i) = 273. + 4. |
---|
| 975 | END IF |
---|
| 976 | END DO |
---|
| 977 | END IF |
---|
[1529] | 978 | |
---|
[1992] | 979 | IF (type_profil==11) THEN |
---|
| 980 | ! Méthode 11 : Méthode 3 + 4CO2 "Qobs" plateau réel à l'Equateur |
---|
| 981 | DO j = 1, klon |
---|
| 982 | phy_sst(j, i) = 273. + 0.5*27.*(2-sin(1.5*rlatd(j))**2-sin(1.5* & |
---|
| 983 | rlatd(j))**4) |
---|
| 984 | IF ((rlatd(j)>1.0471975) .OR. (rlatd(j)<-1.0471975)) THEN |
---|
| 985 | phy_sst(j, i) = 273. |
---|
| 986 | END IF |
---|
| 987 | END DO |
---|
| 988 | END IF |
---|
[1529] | 989 | |
---|
[1992] | 990 | IF (type_profil==12) THEN |
---|
| 991 | ! Méthode 12 : Méthode 10 + 4CO2 "Qobs" plateau réel à l'Equateur |
---|
| 992 | DO j = 1, klon |
---|
| 993 | phy_sst(j, i) = 273. + 4. + 0.5*27.*(2-sin(1.5*rlatd(j))**2-sin(1.5 & |
---|
| 994 | *rlatd(j))**4) |
---|
| 995 | IF ((rlatd(j)>1.0471975) .OR. (rlatd(j)<-1.0471975)) THEN |
---|
| 996 | phy_sst(j, i) = 273. + 4. |
---|
| 997 | END IF |
---|
| 998 | END DO |
---|
| 999 | END IF |
---|
[1529] | 1000 | |
---|
[1992] | 1001 | IF (type_profil==13) THEN |
---|
| 1002 | ! Méthode 13 "Qmax" plateau réel à l'Equateur augmenté ! |
---|
| 1003 | DO j = 1, klon |
---|
| 1004 | phy_sst(j, i) = 273. + 0.5*29.*(2-sin(1.5*rlatd(j))**2-sin(1.5* & |
---|
| 1005 | rlatd(j))**4) |
---|
| 1006 | IF ((rlatd(j)>1.0471975) .OR. (rlatd(j)<-1.0471975)) THEN |
---|
| 1007 | phy_sst(j, i) = 273. |
---|
| 1008 | END IF |
---|
| 1009 | END DO |
---|
| 1010 | END IF |
---|
[1529] | 1011 | |
---|
[1992] | 1012 | IF (type_profil==14) THEN |
---|
| 1013 | ! Méthode 13 "Qmax2K" plateau réel à l'Equateur augmenté +2K ! |
---|
| 1014 | DO j = 1, klon |
---|
| 1015 | phy_sst(j, i) = 273. + 2. + 0.5*29.*(2-sin(1.5*rlatd(j))**2-sin(1.5 & |
---|
| 1016 | *rlatd(j))**4) |
---|
| 1017 | IF ((rlatd(j)>1.0471975) .OR. (rlatd(j)<-1.0471975)) THEN |
---|
| 1018 | phy_sst(j, i) = 273. |
---|
| 1019 | END IF |
---|
| 1020 | END DO |
---|
| 1021 | END IF |
---|
[1529] | 1022 | |
---|
[2107] | 1023 | if (type_profil.EQ.20) then |
---|
| 1024 | print*,'Profile SST 20' |
---|
| 1025 | ! Méthode 13 "Qmax2K" plateau réel �| l'Equateur augmenté +2K |
---|
| 1026 | |
---|
| 1027 | do j=1,klon |
---|
| 1028 | phy_sst(j,i)=248.+55.*(1-sin(rlatd(j))**2) |
---|
| 1029 | enddo |
---|
| 1030 | endif |
---|
| 1031 | |
---|
| 1032 | if (type_profil.EQ.21) then |
---|
| 1033 | print*,'Profile SST 21' |
---|
| 1034 | ! Méthode 13 "Qmax2K" plateau réel �| l'Equateur augmenté +2K |
---|
| 1035 | do j=1,klon |
---|
| 1036 | phy_sst(j,i)=252.+55.*(1-sin(rlatd(j))**2) |
---|
| 1037 | enddo |
---|
| 1038 | endif |
---|
| 1039 | |
---|
| 1040 | |
---|
| 1041 | |
---|
[1992] | 1042 | END DO |
---|
| 1043 | |
---|
| 1044 | ! IM beg : verif profil SST: phy_sst |
---|
| 1045 | amn = min(phy_sst(1,1), 1000.) |
---|
| 1046 | amx = max(phy_sst(1,1), -1000.) |
---|
| 1047 | imn = 1 |
---|
| 1048 | kmn = 1 |
---|
| 1049 | imx = 1 |
---|
| 1050 | kmx = 1 |
---|
[3540] | 1051 | DO k = 1, year_len |
---|
[1992] | 1052 | DO i = 2, nlon |
---|
| 1053 | IF (phy_sst(i,k)<amn) THEN |
---|
| 1054 | amn = phy_sst(i, k) |
---|
| 1055 | imn = i |
---|
| 1056 | kmn = k |
---|
| 1057 | END IF |
---|
| 1058 | IF (phy_sst(i,k)>amx) THEN |
---|
| 1059 | amx = phy_sst(i, k) |
---|
| 1060 | imx = i |
---|
| 1061 | kmx = k |
---|
| 1062 | END IF |
---|
| 1063 | END DO |
---|
| 1064 | END DO |
---|
| 1065 | |
---|
| 1066 | PRINT *, 'profil_sst: imn, kmn, phy_sst(imn,kmn) ', imn, kmn, amn |
---|
| 1067 | PRINT *, 'profil_sst: imx, kmx, phy_sst(imx,kmx) ', imx, kmx, amx |
---|
| 1068 | ! IM end : verif profil SST: phy_sst |
---|
| 1069 | |
---|
| 1070 | RETURN |
---|
| 1071 | END SUBROUTINE profil_sst |
---|
| 1072 | |
---|
| 1073 | END MODULE phyaqua_mod |
---|