| 1 | MODULE output_physiqex_mod |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | CONTAINS |
|---|
| 6 | |
|---|
| 7 | SUBROUTINE output_physiqex(debut,zjulian,pdtphys,presnivs,paprs,u,v,t,qx,cf,zqr,zqs,zqg,ptke,theta) |
|---|
| 8 | |
|---|
| 9 | USE dimphy, only : klon,klev |
|---|
| 10 | USE iophy, only : histbeg_phy,histwrite_phy |
|---|
| 11 | USE ioipsl, only : histvert,histdef,histend,histsync |
|---|
| 12 | USE mod_phys_lmdz_para, only : jj_nb |
|---|
| 13 | USE ioipsl_getin_p_mod, ONLY : getin_p |
|---|
| 14 | USE mod_grid_phy_lmdz, ONLY: nbp_lon,nbp_lat |
|---|
| 15 | USE iophy, ONLY : init_iophy_new |
|---|
| 16 | USE geometry_mod, ONLY: latitude_deg, longitude_deg |
|---|
| 17 | USE infotrac_phy, only : nqtot |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | implicit none |
|---|
| 22 | logical, intent(in) :: debut |
|---|
| 23 | real, intent(in) :: pdtphys,zjulian |
|---|
| 24 | real,intent(in) :: presnivs(klev) ! pseudo-pressure (Pa) of mid-layers |
|---|
| 25 | real,intent(in) :: u(klon,klev) ! eastward zonal wind (m/s) |
|---|
| 26 | real,intent(in) :: v(klon,klev) ! northward meridional wind (m/s) |
|---|
| 27 | real,intent(in) :: t(klon,klev) ! temperature (K) |
|---|
| 28 | real,intent(in) :: theta(klon,klev) ! temperature (K) |
|---|
| 29 | real,intent(in) :: paprs(klon,klev+1) ! interlayer pressure (Pa) |
|---|
| 30 | real,intent(in) :: qx(klon,klev,nqtot) !tracers |
|---|
| 31 | real,intent(in) :: cf(klon,klev) !cloud fraction |
|---|
| 32 | real,intent(in) :: zqr(klon,klev) !rain specifiq content |
|---|
| 33 | real,intent(in) :: zqs(klon,klev) !snow specifiq content |
|---|
| 34 | real,intent(in) :: zqg(klon,klev) !graupel specifiq content |
|---|
| 35 | real,intent(in) :: ptke(klon,klev) !tke |
|---|
| 36 | |
|---|
| 37 | real :: t_ops ! frequency of the IOIPSL operations (eg average over...) |
|---|
| 38 | real :: t_wrt ! frequency of the IOIPSL outputs |
|---|
| 39 | integer :: zvertid ! vertical coordinate ID |
|---|
| 40 | real :: dtime |
|---|
| 41 | |
|---|
| 42 | integer,save :: iwrite_phys=1 ! output every iwrite_phys physics step |
|---|
| 43 | !$OMP THREADPRIVATE(iwrite_phys) |
|---|
| 44 | integer :: nhori ! horizontal coordinate ID |
|---|
| 45 | integer,save :: nid_hist ! output file ID |
|---|
| 46 | !$OMP THREADPRIVATE(nid_hist) |
|---|
| 47 | integer, save :: itau=0 |
|---|
| 48 | !$OMP THREADPRIVATE(itau) |
|---|
| 49 | |
|---|
| 50 | integer, save :: ioex=1 |
|---|
| 51 | |
|---|
| 52 | |
|---|
| 53 | print*,'nnnnnnn ',nid_hist,debut,itau |
|---|
| 54 | |
|---|
| 55 | if(debut)then |
|---|
| 56 | |
|---|
| 57 | call getin_p("iwrite_phys",iwrite_phys) |
|---|
| 58 | |
|---|
| 59 | !$OMP MASTER |
|---|
| 60 | CALL iophys_ini(pdtphys) |
|---|
| 61 | !$OMP END MASTER |
|---|
| 62 | !$OMP BARRIER |
|---|
| 63 | |
|---|
| 64 | endif |
|---|
| 65 | |
|---|
| 66 | |
|---|
| 67 | itau=itau+1 |
|---|
| 68 | |
|---|
| 69 | if (modulo(itau,iwrite_phys)==0) then |
|---|
| 70 | call iophys_ecrit('temp',klev,'Temperature','K',t) |
|---|
| 71 | call iophys_ecrit('u',klev,'zonal wind','m/s',u) |
|---|
| 72 | call iophys_ecrit('v',klev,'meridinal wind','m/s',v) |
|---|
| 73 | call iophys_ecrit('ps',1,'Surface pressure','Pa',paprs(:,1)) |
|---|
| 74 | call iophys_ecrit('qv',klev,'Water vapor specifiq content', 'kg/kg', qx(:,:,1)) |
|---|
| 75 | call iophys_ecrit('qc',klev,'Cloud liquid water specifiq content', 'kg/kg', qx(:,:,2)) |
|---|
| 76 | call iophys_ecrit('qi',klev,'Cloud solid water specifiq content', 'kg/kg', qx(:,:,3)) |
|---|
| 77 | call iophys_ecrit('CF',klev,'Cloud fraction', '0-1', cf) |
|---|
| 78 | call iophys_ecrit('qr',klev,'Rain specifiq content', 'kg/kg', zqr) |
|---|
| 79 | call iophys_ecrit('qs',klev,'Snow specifiq content', 'kg/kg', zqs) |
|---|
| 80 | call iophys_ecrit('qg',klev,'Graupel specifiq content', 'kg/kg', zqg) |
|---|
| 81 | call iophys_ecrit('TKE',klev,'TKE', 'm2/s2', ptke) |
|---|
| 82 | call iophys_ecrit('theta',klev,'Temperature potentielle', 'K', theta) |
|---|
| 83 | endif |
|---|
| 84 | |
|---|
| 85 | |
|---|
| 86 | END SUBROUTINE output_physiqex |
|---|
| 87 | END MODULE output_physiqex_mod |
|---|