[1798] | 1 | ! |
---|
| 2 | ! $Header$ |
---|
| 3 | ! |
---|
| 4 | MODULE phys_output_write_mod |
---|
| 5 | |
---|
| 6 | ! Author: Abderrahmane IDELKADI (original include file) |
---|
| 7 | ! Author: Laurent FAIRHEAD (transformation to module/subroutine) |
---|
| 8 | ! Author: Ulysse GERARD (effective implementation) |
---|
| 9 | |
---|
| 10 | |
---|
| 11 | CONTAINS |
---|
| 12 | |
---|
| 13 | ! ug Routine pour définir (los du premier passageà) ET sortir les variables |
---|
| 14 | SUBROUTINE phys_output_write(itap, pdtphys, paprs, pphis, & |
---|
| 15 | & pplay, lmax_th, aerosol_couple, & |
---|
| 16 | & ok_ade, ok_aie, ivap, new_aod, ok_sync, & |
---|
| 17 | & ptconv, read_climoz, clevSTD, ptconvth, & |
---|
| 18 | & d_t, qx, d_qx, zmasse, flag_aerosol_strat) |
---|
| 19 | |
---|
| 20 | ! This subroutine does the actual writing of diagnostics that were |
---|
| 21 | ! defined and initialised in phys_output_mod.F90 |
---|
| 22 | |
---|
| 23 | USE dimphy |
---|
| 24 | USE control_mod |
---|
| 25 | USE phys_output_ctrlout_mod |
---|
| 26 | USE phys_state_var_mod |
---|
| 27 | USE phys_local_var_mod |
---|
| 28 | USE indice_sol_mod |
---|
| 29 | USE infotrac |
---|
| 30 | USE comgeomphy |
---|
| 31 | USE surface_data, ONLY : type_ocean, ok_veget |
---|
| 32 | USE aero_mod |
---|
| 33 | USE ioipsl |
---|
| 34 | USE write_field_phy |
---|
| 35 | USE iophy |
---|
| 36 | |
---|
| 37 | IMPLICIT NONE |
---|
| 38 | |
---|
| 39 | INCLUDE "temps.h" |
---|
| 40 | INCLUDE "clesphys.h" |
---|
| 41 | INCLUDE "thermcell.h" |
---|
| 42 | INCLUDE "compbl.h" |
---|
| 43 | INCLUDE "YOMCST.h" |
---|
| 44 | INCLUDE "dimensions.h" |
---|
| 45 | |
---|
| 46 | ! Input |
---|
| 47 | INTEGER :: itap, ivap, read_climoz |
---|
| 48 | INTEGER, DIMENSION(klon) :: lmax_th |
---|
| 49 | LOGICAL :: aerosol_couple, ok_sync |
---|
| 50 | LOGICAL :: ok_ade, ok_aie, new_aod |
---|
| 51 | LOGICAL, DIMENSION(klon, klev) :: ptconv, ptconvth |
---|
| 52 | REAL :: pdtphys |
---|
| 53 | CHARACTER (LEN=4), DIMENSION(nlevSTD) :: clevSTD |
---|
| 54 | REAL, DIMENSION(klon) :: pphis |
---|
| 55 | REAL, DIMENSION(klon, klev) :: pplay, d_t |
---|
| 56 | REAL, DIMENSION(klon, klev+1) :: paprs |
---|
| 57 | REAL, DIMENSION(klon,klev,nqtot) :: qx, d_qx |
---|
| 58 | REAL, DIMENSION(klon, llm) :: zmasse |
---|
| 59 | LOGICAL :: flag_aerosol_strat |
---|
| 60 | |
---|
| 61 | ! Local |
---|
| 62 | INTEGER, PARAMETER :: jjmp1=jjm+1-1/jjm |
---|
| 63 | INTEGER :: itau_w |
---|
| 64 | INTEGER :: i, iff, iq, nsrf, k, ll, naero |
---|
| 65 | REAL, DIMENSION (klon) :: zx_tmp_fi2d |
---|
| 66 | REAL, DIMENSION (klon,klev) :: zx_tmp_fi3d, zpt_conv |
---|
| 67 | REAL, DIMENSION (klon,klev+1) :: zx_tmp_fi3d1 |
---|
| 68 | CHARACTER (LEN=4) :: bb2 |
---|
| 69 | INTEGER, DIMENSION(iim*jjmp1) :: ndex2d |
---|
| 70 | INTEGER, DIMENSION(iim*jjmp1*klev) :: ndex3d |
---|
| 71 | REAL, PARAMETER :: dobson_u = 2.1415e-05 ! Dobson unit, in kg m-2 |
---|
| 72 | |
---|
| 73 | IF(vars_defined) THEN |
---|
| 74 | ! On calcul le nouveau tau: |
---|
| 75 | itau_w = itau_phy + itap + start_time * day_step / iphysiq |
---|
| 76 | ! On le donne à iophy pour que les histwrite y aient accès: |
---|
| 77 | CALL set_itau_iophy(itau_w) |
---|
| 78 | ENDIF |
---|
| 79 | |
---|
| 80 | ! On procède à l'écriture ou à la définition des nombreuses variables: |
---|
| 81 | #include "phys_output_write_F90.h" |
---|
| 82 | |
---|
| 83 | IF(vars_defined) THEN |
---|
| 84 | ! On synchronise les fichiers pour IOIPSL |
---|
| 85 | DO iff=1,nfiles |
---|
| 86 | IF (ok_sync .AND. clef_files(iff)) THEN |
---|
| 87 | !$OMP MASTER |
---|
| 88 | CALL histsync(nid_files(iff)) |
---|
| 89 | !$OMP END MASTER |
---|
| 90 | ENDIF |
---|
| 91 | END DO |
---|
[1807] | 92 | |
---|
| 93 | ELSE |
---|
| 94 | vars_defined = .TRUE. |
---|
[1798] | 95 | ENDIF |
---|
| 96 | |
---|
| 97 | |
---|
| 98 | |
---|
[1807] | 99 | |
---|
[1798] | 100 | END SUBROUTINE phys_output_write |
---|
| 101 | |
---|
| 102 | |
---|
| 103 | |
---|
| 104 | END MODULE phys_output_write_mod |
---|
| 105 | |
---|