[5099] | 1 | |
---|
[1403] | 2 | ! $Id: initphysto.F90 5110 2024-07-24 09:19:08Z abarral $ |
---|
[5099] | 3 | |
---|
[1447] | 4 | SUBROUTINE initphysto(infile,tstep,t_ops,t_wrt,fileid) |
---|
| 5 | |
---|
| 6 | USE dimphy |
---|
[5110] | 7 | USE lmdz_phys_para |
---|
[1447] | 8 | USE IOIPSL |
---|
| 9 | USE iophy |
---|
[1785] | 10 | USE indice_sol_mod |
---|
[5110] | 11 | USE lmdz_grid_phy, ONLY: nbp_lon, nbp_lat, nbp_lev |
---|
[2343] | 12 | USE time_phylmdz_mod, ONLY: day_ref, annee_ref |
---|
[1447] | 13 | |
---|
| 14 | IMPLICIT NONE |
---|
[1403] | 15 | |
---|
[1447] | 16 | ! Routine d'initialisation des ecritures des fichiers histoires LMDZ |
---|
| 17 | ! au format IOIPSL |
---|
[5099] | 18 | |
---|
[1447] | 19 | ! Appels succesifs des routines: histbeg |
---|
| 20 | ! histhori |
---|
| 21 | ! histver |
---|
| 22 | ! histdef |
---|
| 23 | ! histend |
---|
[5099] | 24 | |
---|
[1447] | 25 | ! Entree: |
---|
[5099] | 26 | |
---|
[1447] | 27 | ! infile: nom du fichier histoire a creer |
---|
| 28 | ! day0,anne0: date de reference |
---|
| 29 | ! tstep: duree du pas de temps en seconde |
---|
| 30 | ! t_ops: frequence de l'operation pour IOIPSL |
---|
| 31 | ! t_wrt: frequence d'ecriture sur le fichier |
---|
[5099] | 32 | |
---|
[1447] | 33 | ! Sortie: |
---|
| 34 | ! fileid: ID du fichier netcdf cree |
---|
[5099] | 35 | |
---|
[1447] | 36 | ! L. Fairhead, LMD, 03/99 |
---|
[5099] | 37 | |
---|
[1447] | 38 | ! ===================================================================== |
---|
[524] | 39 | |
---|
[1447] | 40 | ! Arguments |
---|
| 41 | CHARACTER(len=*), INTENT(IN) :: infile |
---|
| 42 | REAL, INTENT(IN) :: tstep |
---|
| 43 | REAL, INTENT(IN) :: t_ops |
---|
| 44 | REAL, INTENT(IN) :: t_wrt |
---|
| 45 | INTEGER, INTENT(OUT) :: fileid |
---|
[524] | 46 | |
---|
[1447] | 47 | ! Variables locales |
---|
| 48 | INTEGER nhoriid, i |
---|
| 49 | INTEGER l,k |
---|
[2343] | 50 | REAL nivsigs(nbp_lev) |
---|
[1447] | 51 | INTEGER tau0 |
---|
| 52 | REAL zjulian |
---|
| 53 | INTEGER iq |
---|
| 54 | INTEGER uhoriid, vhoriid, thoriid, zvertiid |
---|
| 55 | INTEGER ii,jj |
---|
| 56 | INTEGER zan, idayref |
---|
| 57 | LOGICAL ok_sync |
---|
[2343] | 58 | REAL zx_lon(nbp_lon,nbp_lat), zx_lat(nbp_lon,nbp_lat) |
---|
[1447] | 59 | CHARACTER(len=12) :: nvar |
---|
[524] | 60 | |
---|
[1447] | 61 | ! Initialisations |
---|
[5099] | 62 | |
---|
[1447] | 63 | ok_sync= .TRUE. |
---|
[5099] | 64 | |
---|
[1447] | 65 | ! Appel a histbeg: creation du fichier netcdf et initialisations diverses |
---|
[524] | 66 | |
---|
[1447] | 67 | zan = annee_ref |
---|
| 68 | idayref = day_ref |
---|
| 69 | CALL ymds2ju(zan, 1, idayref, 0.0, zjulian) |
---|
| 70 | tau0 = 0 |
---|
| 71 | |
---|
| 72 | CALL histbeg_phy(infile,tau0, zjulian, tstep, & |
---|
| 73 | nhoriid, fileid) |
---|
[524] | 74 | |
---|
[1447] | 75 | !$OMP MASTER |
---|
| 76 | ! Appel a histvert pour la grille verticale |
---|
[5099] | 77 | |
---|
[2343] | 78 | DO l=1,nbp_lev |
---|
[1447] | 79 | nivsigs(l)=REAL(l) |
---|
| 80 | ENDDO |
---|
| 81 | |
---|
| 82 | CALL histvert(fileid, 'sig_s', 'Niveaux sigma', & |
---|
| 83 | 'sigma_level', & |
---|
[2343] | 84 | nbp_lev, nivsigs, zvertiid) |
---|
[5099] | 85 | |
---|
[1447] | 86 | ! Appels a histdef pour la definition des variables a sauvegarder |
---|
[5099] | 87 | |
---|
[1447] | 88 | CALL histdef(fileid, "phis", "Surface geop. height", "-", & |
---|
[2343] | 89 | nbp_lon,jj_nb,nhoriid, 1,1,1, -99, 32, & |
---|
[1447] | 90 | "once", t_ops, t_wrt) |
---|
| 91 | |
---|
| 92 | CALL histdef(fileid, "aire", "Grid area", "-", & |
---|
[2343] | 93 | nbp_lon,jj_nb,nhoriid, 1,1,1, -99, 32, & |
---|
[1447] | 94 | "once", t_ops, t_wrt) |
---|
[524] | 95 | |
---|
[1447] | 96 | CALL histdef(fileid, "longitudes", "longitudes", "-", & |
---|
[2343] | 97 | nbp_lon,jj_nb,nhoriid, 1,1,1, -99, 32, & |
---|
[1447] | 98 | "once", t_ops, t_wrt) |
---|
[524] | 99 | |
---|
[1447] | 100 | CALL histdef(fileid, "latitudes", "latitudes", "-", & |
---|
[2343] | 101 | nbp_lon,jj_nb,nhoriid, 1,1,1, -99, 32, & |
---|
[1447] | 102 | "once", t_ops, t_wrt) |
---|
| 103 | ! T |
---|
[2343] | 104 | CALL histdef(fileid, 't', 'Temperature', 'K', nbp_lon, jj_nb, nhoriid, & |
---|
| 105 | nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt) |
---|
[1447] | 106 | ! mfu |
---|
[2343] | 107 | CALL histdef(fileid, 'mfu', 'flx m. pan. mt', 'kg m/s',nbp_lon, jj_nb, nhoriid, & |
---|
| 108 | nbp_lev, 1, nbp_lev, zvertiid,32, 'inst(X)', t_ops, t_wrt) |
---|
[1447] | 109 | ! mfd |
---|
[2343] | 110 | CALL histdef(fileid, 'mfd', 'flx m. pan. des', 'kg m/s',nbp_lon, jj_nb, nhoriid, & |
---|
| 111 | nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt) |
---|
[1447] | 112 | ! en_u |
---|
[2343] | 113 | CALL histdef(fileid, 'en_u', 'flx ent pan mt', 'kg m/s', nbp_lon, jj_nb, nhoriid, & |
---|
| 114 | nbp_lev, 1, nbp_lev, zvertiid,32, 'inst(X)', t_ops, t_wrt) |
---|
[1447] | 115 | ! de_u |
---|
[2343] | 116 | CALL histdef(fileid, 'de_u', 'flx det pan mt', 'kg m/s',nbp_lon, jj_nb, nhoriid, & |
---|
| 117 | nbp_lev, 1, nbp_lev, zvertiid,32, 'inst(X)', t_ops, t_wrt) |
---|
[1447] | 118 | ! en_d |
---|
[2343] | 119 | CALL histdef(fileid, 'en_d', 'flx ent pan dt', 'kg m/s', nbp_lon, jj_nb, nhoriid, & |
---|
| 120 | nbp_lev, 1, nbp_lev, zvertiid,32, 'inst(X)', t_ops, t_wrt) |
---|
[1447] | 121 | ! de_d |
---|
[2343] | 122 | CALL histdef(fileid, 'de_d', 'flx det pan dt', 'kg m/s', nbp_lon, jj_nb, nhoriid, & |
---|
| 123 | nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt) |
---|
[1447] | 124 | ! coefh |
---|
[2343] | 125 | CALL histdef(fileid, "coefh", " ", " ", nbp_lon, jj_nb, nhoriid, & |
---|
| 126 | nbp_lev, 1, nbp_lev, zvertiid,32, "inst(X)", t_ops, t_wrt) |
---|
[1447] | 127 | ! fm_th |
---|
[2343] | 128 | CALL histdef(fileid, "fm_th", " ", " ",nbp_lon, jj_nb, nhoriid, & |
---|
| 129 | nbp_lev, 1, nbp_lev, zvertiid,32, "inst(X)", t_ops, t_wrt) |
---|
[1447] | 130 | ! en_th |
---|
[2343] | 131 | CALL histdef(fileid, "en_th", " ", " ",nbp_lon, jj_nb, nhoriid, & |
---|
| 132 | nbp_lev, 1, nbp_lev, zvertiid,32, "inst(X)", t_ops, t_wrt) |
---|
[1447] | 133 | ! frac_impa |
---|
[2343] | 134 | CALL histdef(fileid, 'frac_impa', ' ', ' ',nbp_lon, jj_nb, nhoriid, & |
---|
| 135 | nbp_lev, 1, nbp_lev, zvertiid,32, 'inst(X)', t_ops, t_wrt) |
---|
[1447] | 136 | ! frac_nucl |
---|
[2343] | 137 | CALL histdef(fileid, 'frac_nucl', ' ', ' ',nbp_lon, jj_nb, nhoriid, & |
---|
| 138 | nbp_lev, 1, nbp_lev, zvertiid,32, 'inst(X)', t_ops, t_wrt) |
---|
[1447] | 139 | ! pyu1 |
---|
[2343] | 140 | CALL histdef(fileid, "pyu1", " ", " ", nbp_lon,jj_nb,nhoriid, & |
---|
[1447] | 141 | 1,1,1, -99, 32, "inst(X)", t_ops, t_wrt) |
---|
| 142 | ! pyv1 |
---|
[2343] | 143 | CALL histdef(fileid, "pyv1", " ", " ", nbp_lon,jj_nb,nhoriid, & |
---|
[1447] | 144 | 1,1,1, -99, 32,"inst(X)", t_ops, t_wrt) |
---|
| 145 | ! ftsol1 |
---|
[2343] | 146 | CALL histdef(fileid, "ftsol1", " ", " ",nbp_lon, jj_nb, nhoriid, & |
---|
[1447] | 147 | 1, 1,1, -99,32, "inst(X)", t_ops, t_wrt) |
---|
| 148 | ! ftsol2 |
---|
[2343] | 149 | CALL histdef(fileid, "ftsol2", " ", " ",nbp_lon, jj_nb, nhoriid, & |
---|
[1447] | 150 | 1, 1,1, -99,32, "inst(X)", t_ops, t_wrt) |
---|
| 151 | ! ftsol3 |
---|
[2343] | 152 | CALL histdef(fileid, "ftsol3", " ", " ", nbp_lon, jj_nb, nhoriid, & |
---|
[1447] | 153 | 1, 1,1, -99,32, "inst(X)", t_ops, t_wrt) |
---|
| 154 | ! ftsol4 |
---|
[2343] | 155 | CALL histdef(fileid, "ftsol4", " ", " ",nbp_lon, jj_nb, nhoriid, & |
---|
[1447] | 156 | 1, 1,1, -99, 32, "inst(X)", t_ops, t_wrt) |
---|
| 157 | ! psrf1 |
---|
[2343] | 158 | CALL histdef(fileid, "psrf1", " ", " ",nbp_lon, jj_nb, nhoriid, & |
---|
[1447] | 159 | 1, 1, 1, -99,32, "inst(X)", t_ops, t_wrt) |
---|
| 160 | ! psrf2 |
---|
[2343] | 161 | CALL histdef(fileid, "psrf2", " ", " ",nbp_lon, jj_nb, nhoriid, & |
---|
[1447] | 162 | 1, 1, 1, -99, 32, "inst(X)", t_ops, t_wrt) |
---|
| 163 | ! psrf3 |
---|
[2343] | 164 | CALL histdef(fileid, "psrf3", " ", " ",nbp_lon, jj_nb, nhoriid, & |
---|
[1447] | 165 | 1, 1, 1, -99, 32, "inst(X)", t_ops, t_wrt) |
---|
| 166 | ! psrf4 |
---|
[2343] | 167 | CALL histdef(fileid, "psrf4", " ", " ", nbp_lon, jj_nb, nhoriid, & |
---|
[1447] | 168 | 1, 1, 1, -99,32, "inst(X)", t_ops, t_wrt) |
---|
| 169 | ! sh |
---|
[2343] | 170 | CALL histdef(fileid, 'sh', '', '', nbp_lon, jj_nb, nhoriid, & |
---|
| 171 | nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt) |
---|
[1447] | 172 | ! da |
---|
[2343] | 173 | CALL histdef(fileid, 'da', '', '', nbp_lon, jj_nb, nhoriid, & |
---|
| 174 | nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt) |
---|
[1447] | 175 | ! mp |
---|
[2343] | 176 | CALL histdef(fileid, 'mp', '', '', nbp_lon, jj_nb, nhoriid, & |
---|
| 177 | nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt) |
---|
[1447] | 178 | ! upwd |
---|
[2343] | 179 | CALL histdef(fileid, 'upwd', '', '', nbp_lon, jj_nb, nhoriid, & |
---|
| 180 | nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt) |
---|
[1447] | 181 | ! dnwd |
---|
[2343] | 182 | CALL histdef(fileid, 'dnwd', '', '', nbp_lon, jj_nb, nhoriid, & |
---|
| 183 | nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt) |
---|
[524] | 184 | |
---|
[1447] | 185 | ! phi |
---|
[2343] | 186 | DO k=1,nbp_lev |
---|
[1447] | 187 | IF (k<10) THEN |
---|
| 188 | WRITE(nvar,'(i1)') k |
---|
| 189 | ELSE IF (k<100) THEN |
---|
| 190 | WRITE(nvar,'(i2)') k |
---|
| 191 | ELSE |
---|
| 192 | WRITE(nvar,'(i3)') k |
---|
| 193 | END IF |
---|
| 194 | nvar='phi_lev'//trim(nvar) |
---|
| 195 | |
---|
[2343] | 196 | CALL histdef(fileid, nvar, '', '', nbp_lon, jj_nb, nhoriid, & |
---|
| 197 | nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt) |
---|
[1447] | 198 | END DO |
---|
[766] | 199 | |
---|
[1447] | 200 | CALL histend(fileid) |
---|
| 201 | IF (ok_sync) CALL histsync |
---|
| 202 | !$OMP END MASTER |
---|
[524] | 203 | |
---|
[1447] | 204 | END SUBROUTINE initphysto |
---|