Changeset 3977 for LMDZ6/trunk
- Timestamp:
- Aug 25, 2021, 7:24:20 PM (3 years ago)
- Location:
- LMDZ6/trunk/libf/phylmd
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/phylmd/Dust/phytracr_spl_mod.F90
r3814 r3977 1249 1249 if (debutphy) then 1250 1250 #ifdef IOPHYS_DUST 1251 CALL iophys_ini 1251 CALL iophys_ini(pdtphys) 1252 1252 #endif 1253 1253 nbreg_ind=1 -
LMDZ6/trunk/libf/phylmd/acama_gwd_rando_m.F90
r3531 r3977 138 138 ENDIF 139 139 firstcall=.false. 140 ! CALL iophys_ini 140 ! CALL iophys_ini(dtime) 141 141 ENDIF 142 142 -
LMDZ6/trunk/libf/phylmd/dyn1d/old_lmdz1d.F90
r3956 r3977 1033 1033 ! 1034 1034 !===================================================================== 1035 CALL iophys_ini 1035 CALL iophys_ini(timestep) 1036 1036 ! START OF THE TEMPORAL LOOP : 1037 1037 !===================================================================== -
LMDZ6/trunk/libf/phylmd/dyn1d/scm.F90
r3956 r3977 789 789 !===================================================================== 790 790 #ifdef OUTPUT_PHYS_SCM 791 CALL iophys_ini 791 CALL iophys_ini(timestep) 792 792 #endif 793 793 -
LMDZ6/trunk/libf/phylmd/iophys.F90
r3115 r3977 56 56 57 57 58 58 59 CALL Gather(px,xglo) 59 60 !$OMP MASTER … … 109 110 110 111 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 111 SUBROUTINE iophys_ini 112 SUBROUTINE iophys_ini(timestep) 112 113 USE mod_phys_lmdz_para, ONLY: is_mpi_root 113 114 USE vertical_layers_mod, ONLY: presnivs … … 115 116 USE dimphy, ONLY: klev 116 117 USE mod_grid_phy_lmdz, ONLY: klon_glo 118 USE temps_mod, ONLY : day_ini,annee_ref,day_ref 119 USE temps_mod, ONLY : jD_ref,jH_ref,start_time, calend 120 USE comconst_mod, ONLY: daysec 121 117 122 118 123 IMPLICIT NONE … … 136 141 real pi 137 142 INTEGER nlat_eff 143 INTEGER jour0,mois0,an0 144 REAL timestep,t0 145 CHARACTER(len=20) :: calendrier 138 146 139 147 ! Arguments: 140 148 ! ---------- 149 141 150 142 151 !$OMP MASTER … … 152 161 ENDIF 153 162 pi=2.*asin(1.) 154 call iotd_ini('phys.nc ', & 155 size(lon_reg),nlat_eff,klev,lon_reg(:)*180./pi,lat_reg*180./pi,presnivs) 163 164 ! print*,'day_ini,annee_ref,day_ref',day_ini,annee_ref,day_ref 165 ! print*,'jD_ref,jH_ref,start_time, calend',jD_ref,jH_ref,start_time, calend 166 167 ! Attention : les lignes ci dessous supposent un calendrier en 360 jours 168 ! Pourrait être retravaillé 169 170 jour0=day_ref-30*(day_ref/30) 171 mois0=day_ref/30+1 172 an0=annee_ref 173 t0=(day_ini-1)*daysec 174 calendrier=calend 175 176 if ( calendrier == "earth_360d" ) calendrier="360d" 177 178 call iotd_ini('phys.nc', & 179 size(lon_reg),nlat_eff,klev,lon_reg(:)*180./pi,lat_reg*180./pi,presnivs,jour0,mois0,an0,t0,timestep,calendrier) 156 180 ENDIF 157 181 !$OMP END MASTER -
LMDZ6/trunk/libf/phylmd/iotd.h
r3102 r3977 12 12 integer imax,jmax,lmax,nid 13 13 INTEGER dim_coord(4) 14 real iotd_ts 14 real iotd_ts,iotd_t0 15 15 16 common/ecritd_c/imax,jmax,lmax,nid,dim_coord,iotd_ts 16 common/ecritd_c/imax,jmax,lmax,nid,dim_coord,iotd_t0,iotd_ts 17 !$OMP THREADPRIVATE(/ecritd_c/) -
LMDZ6/trunk/libf/phylmd/iotd_ecrit.F90
r3102 r3977 74 74 75 75 76 ! Compute/write/extend ' Time' coordinate (date given in days)76 ! Compute/write/extend 'time' coordinate (date given in days) 77 77 ! (done every "first call" (at given time level) to writediagfi) 78 78 ! Note: date is incremented as 1 step ahead of physics time … … 84 84 endif 85 85 86 !print*,'nom ',nom,firstnom86 !print*,'nom ',nom,firstnom 87 87 88 88 !! Quand on tombe sur la premiere variable on ajoute un pas de temps … … 93 93 94 94 !! print*,'ntime ',ntime 95 date=ntime 95 date=iotd_t0+ntime*iotd_ts 96 print*,'iotd_ecrit ',iotd_ts,ntime, date 96 97 ! date= float (zitau +1)/float (day_step) 97 98 98 99 ! compute corresponding date (in days and fractions thereof) 99 ! Get NetCDF ID of ' Time' variable100 ! Get NetCDF ID of 'time' variable 100 101 101 102 ierr=NF_SYNC(nid) 102 103 103 ierr= NF_INQ_VARID(nid," Time",varid)104 ! Write (append) the new date to the ' Time' array104 ierr= NF_INQ_VARID(nid,"time",varid) 105 ! Write (append) the new date to the 'time' array 105 106 106 107 -
LMDZ6/trunk/libf/phylmd/iotd_ini.F90
r3102 r3977 1 SUBROUTINE iotd_ini(fichnom,iim,jjm,llm,prlon v,prlatu,pcoordv)1 SUBROUTINE iotd_ini(fichnom,iim,jjm,llm,prlon,prlat,pcoordv,jour0,mois0,an0,t0,timestep,calendrier) 2 2 IMPLICIT NONE 3 3 … … 23 23 24 24 integer iim,jjm,llm 25 real prlon v(iim),prlatu(jjm),pcoordv(llm),timestep25 real prlon(iim),prlat(jjm),pcoordv(llm),timestep,t0 26 26 INTEGER id_FOCE 27 INTEGER jour0,mois0,an0 28 CHARACTER*(*) calendrier 27 29 28 30 integer corner(4),edges(4),ndim 29 31 real px(1000) 30 32 character (len=10) :: nom 33 real*4 rlon(iim),rlat(jjm),coordv(llm) 31 34 32 35 ! Local: 33 36 ! ------ 37 CHARACTER*3,DIMENSION(12) :: cmois=(/'JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC'/) 38 CHARACTER*10 date0 39 CHARACTER*11 date0b 40 34 41 INTEGER ierr 35 42 36 43 integer :: nvarid 37 44 integer, dimension(2) :: id 38 integer :: varid39 45 40 character*10 fichnom 41 real*4 rlonv(iim),rlatu(jjm),coordv(llm) 46 character*(*) fichnom 42 47 43 48 real pi 44 49 45 print*,'INIIO prlonv ',prlonv 50 iotd_ts=timestep 51 iotd_t0=t0 52 print*,'iotd_ini, ',timestep,iotd_ts 46 53 imax=iim 47 54 jmax=jjm 48 55 lmax=llm 56 ! Utile pour passer en real*4 pour les ecritures 57 rlon=prlon 58 rlat=prlat 59 coordv=pcoordv 49 60 50 rlonv=prlonv51 rlatu=prlatu52 coordv=pcoordv53 61 54 62 !----------------------------------------------------------------------- … … 59 67 ! Define dimensions 60 68 61 ! Create the NetCDF file 62 ierr=NF_CREATE(fichnom, NF_CLOBBER, nid) 63 ! Define the 'Time' dimension 64 ierr=nf_def_dim(nid,"Time",NF_UNLIMITED,dim_coord(4)) 65 ! Define the 'Time' variable 66 ierr=NF_DEF_VAR(nid, "Time", NF_FLOAT, 1, dim_coord(4),varid) 67 ! ! Add a long_name attribute 68 ! ierr=NF_PUT_ATT_TEXT(nid, varid, "long_name",4,"Time") 69 ! ! Add a units attribute 70 ierr=NF_PUT_ATT_TEXT(nid, varid,'units',29,"days since 0000-00-0 00:00:00") 71 ! Switch out of NetCDF Define mode 69 ! Create the NetCDF file 70 ierr=NF_CREATE(fichnom, NF_CLOBBER, nid) 71 ierr=NF_DEF_DIM(nid, "lon", iim, dim_coord(1)) 72 ierr=NF_DEF_DIM(nid, "lat", jjm, dim_coord(2)) 73 ierr=NF_DEF_DIM(nid, "lev", llm, dim_coord(3)) 74 ierr=NF_DEF_DIM(nid,"time",NF_UNLIMITED,dim_coord(4)) 75 ierr = NF_PUT_ATT_TEXT(nid,NF_GLOBAL,'Conventions',6,"CF-1.1") 76 !ierr = NF_PUT_ATT_TEXT(nid,NF_GLOBAL,'file_name',TRIM(fname)) 77 ierr=NF_ENDDEF(nid) 72 78 73 ierr=NF_DEF_DIM(nid, "longitude", iim, dim_coord(1)) 74 ierr=NF_DEF_DIM(nid, "latitude", jjm, dim_coord(2)) 75 ierr=NF_DEF_DIM(nid, "altitude", llm, dim_coord(3)) 79 ! Switch out of NetCDF Define mode 76 80 77 81 … … 79 83 ! 80 84 ! Contol parameters for this run 81 ! ---- ----------------------85 ! ---- longitude ----------- 82 86 83 87 ierr=NF_REDEF(nid) 84 ierr=NF_DEF_VAR(nid,"longitude", NF_FLOAT, 1, dim_coord(1),nvarid) 85 ! ierr=NF_PUT_ATT_TEXT(nid,nvarid,"long_name", 14, 86 ! . "East longitude") 87 ! ierr=NF_PUT_ATT_TEXT(nid,nvarid,'units',12,"degrees_east") 88 ierr=NF_DEF_VAR(nid,"lon", NF_FLOAT, 1, dim_coord(1),nvarid) 89 ierr = NF_PUT_ATT_TEXT(nid,nvarid,'axis',1,'X') 90 ierr=NF_PUT_ATT_TEXT(nid,nvarid,'units',12,"degrees_east") 88 91 ierr=NF_ENDDEF(nid) 89 ierr=NF_PUT_VAR_REAL(nid,nvarid,rlon v)92 ierr=NF_PUT_VAR_REAL(nid,nvarid,rlon) 90 93 print*,ierr 91 94 92 ! ---- ----------------------95 ! ---- latitude ------------ 93 96 ierr=NF_REDEF(nid) 94 ierr=NF_DEF_VAR(nid, "lat itude", NF_FLOAT, 1, dim_coord(2),nvarid)95 ! ierr=NF_PUT_ATT_TEXT(nid,nvarid,'units',13,"degrees_north")96 ! ierr=NF_PUT_ATT_TEXT(nid,nvarid,"long_name", 14,"North latitude")97 ierr=NF_DEF_VAR(nid, "lat", NF_FLOAT, 1, dim_coord(2),nvarid) 98 ierr = NF_PUT_ATT_TEXT(nid,nvarid,'axis',1,'Y') 99 ierr=NF_PUT_ATT_TEXT(nid,nvarid,'units',13,"degrees_north") 97 100 ierr=NF_ENDDEF(nid) 98 ierr=NF_PUT_VAR_REAL(nid,nvarid,rlat u)101 ierr=NF_PUT_VAR_REAL(nid,nvarid,rlat) 99 102 ! 100 ! ---- ----------------------103 ! ---- vertical ------------ 101 104 ierr=NF_REDEF(nid) 102 ierr=NF_DEF_VAR(nid, "altitude", NF_FLOAT, 1,dim_coord(3),nvarid) 103 ierr=NF_PUT_ATT_TEXT(nid,nvarid,"long_name",10,"pseudo-alt") 104 ! ierr=NF_PUT_ATT_TEXT(nid,nvarid,'units',2,"km") 105 if ( pcoordv(2)>pcoordv(1) ) then 105 ierr=NF_DEF_VAR(nid, "lev", NF_FLOAT, 1,dim_coord(3),nvarid) 106 ierr=NF_PUT_ATT_TEXT(nid,nvarid,"long_name",10,"vert level") 107 if ( coordv(2)>coordv(1) ) then 106 108 ierr=NF_PUT_ATT_TEXT(nid,nvarid,"long_name",10,"pseudo-alt") 107 109 ierr=NF_PUT_ATT_TEXT(nid,nvarid,'positive',2,"up") … … 111 113 endif 112 114 ierr=NF_ENDDEF(nid) 115 ierr=NF_PUT_VAR_REAL(nid,nvarid,coordv) 113 116 114 ierr=NF_PUT_VAR_REAL(nid,nvarid,coordv)115 117 ! 118 ! ---- time ---------------- 119 ierr=NF_REDEF(nid) 120 ! Define the 'time' variable 121 ierr=NF_DEF_VAR(nid, "time", NF_FLOAT, 1, dim_coord(4),nvarid) 122 ! ! Add attributes 123 ierr = NF_PUT_ATT_TEXT(nid,nvarid,'axis',1,'T') 124 ierr = NF_PUT_ATT_TEXT(nid,nvarid,'standard_name',4,'time') 125 WRITE(date0,'(i4.4,"-",i2.2,"-",i2.2)') an0,mois0,jour0 126 ierr=NF_PUT_ATT_TEXT(nid, nvarid,'units',33, & 127 & "seconds since "//date0//" 00:00:00") 128 ierr = NF_PUT_ATT_TEXT(nid,nvarid,'calendar',9,calendrier) 129 !ierr = NF_PUT_ATT_TEXT(nid,nvarid,'calendar',4,'360d') 130 ierr = NF_PUT_ATT_TEXT(nid,nvarid,'title',4,'Time') 131 ierr = NF_PUT_ATT_TEXT(nid,nvarid,'long_name',9,'Time axis') 132 WRITE(date0b,'(i4.4,"-",a3,"-",i2.2)') an0,cmois(mois0),jour0 133 ierr = NF_PUT_ATT_TEXT(nid,nvarid,'time_origin',20, & 134 & date0b//' 00:00:00') 135 ierr=NF_ENDDEF(nid) 136 137 116 138 END -
LMDZ6/trunk/libf/phylmd/yamada_c.F90
r2680 r3977 139 139 #define IOPHYS 140 140 #ifdef IOPHYS 141 ! call iophys_ini 141 ! call iophys_ini(timestep) 142 142 #endif 143 143 firstcall=.false.
Note: See TracChangeset
for help on using the changeset viewer.