79 USE modd_csts, ONLY : xpi, xday, xrv, xrd, xg
83 cfileout_fa, nunit_fa, cdnomc, &
84 iverbfa, lfanocompact, cfilepgd_fa
85 USE modd_io_surf_lfi,ONLY : cfilein_lfi, cfilein_lfi_save, cluout_lfi, cfileout_lfi, &
86 lmnh_compatible, cfilepgd_lfi
87 USE modd_io_surf_nc, ONLY : cfilein_nc, cfilein_nc_save, cfileout_nc, cluout_nc, &
90 ldefined_nature, ldefined_sea, &
91 ldefined_water, ldefined_town, &
92 ldefined_surf_atm, lpartw, &
93 xstartw, xcountw, ltime_written, &
98 nindex, nsize_task, xtime_npio_read, xtime_npio_write, &
99 xtime_comm_read, xtime_comm_write, xtime_sea, &
100 xtime_nature, xtime_water, xtime_town, &
101 xtime_init_sea, xtime_init_water, &
102 xtime_init_nature, xtime_init_town, &
103 xtime_write, xtime_calc, xtime_omp_barr, &
108 nwork_full, nwork2_full, xwork_full, xwork2_full
111 lcoupl_topd, ntopd_step, nyear, nmonth, nday, nh, nm
112 USE modd_topodyn, ONLY : xtopd_step, nnb_topd_step, xqtot, xqb_run, xqb_dr
115 xslopazi_thread,xsurf_triangle_thread
126 USE modi_open_namelist
128 USE modi_close_namelist
129 USE modi_read_all_namelists
130 USE modi_open_close_bin_asc_forc
131 USE modi_open_filein_ol
132 USE modi_ol_read_atm_conf
134 USE modi_ol_alloc_atm
135 USE modi_compare_orography
137 USE modi_init_index_mpi
139 USE modi_get_sizes_parallel
140 USE modi_io_buff_clean
141 USE modi_init_surf_atm_n
142 USE modi_init_surf_landuse_n
143 USE modi_ol_time_interp_atm
144 USE modi_coupling_surf_atm_n
145 USE modi_add_forecast_to_date_surf
146 USE modi_write_surf_atm_n
147 USE modi_write_header_mnh
149 USE modi_flag_diag_update
150 USE modi_diag_surf_atm_n
151 USE modi_write_diag_surf_atm_n
152 USE modi_get_surf_var_n
154 USE modi_close_filein_ol
155 USE modi_close_fileout_ol
156 USE modi_init_output_ol_n
157 USE modi_init_output_nc_n
159 USE modi_write_header_fa
162 USE modi_write_discharge_file
163 USE modi_write_budget_coupl_rout
164 USE modi_prep_restart_coupl_topd
166 USE modi_init_slope_param
167 USE modi_slope_radiative_effect
169 USE modi_sfx_oasis_init
170 USE modi_sfx_oasis_read_nam
171 USE modi_sfx_oasis_def_ol
172 USE modi_sfx_oasis_recv_ol
173 USE modi_sfx_oasis_send_ol
174 USE modi_sfx_oasis_end
176 USE modi_local_slope_param
180 USE yomhook
,ONLY : lhook, dr_hook
181 USE parkind1
,ONLY : jprb
199 CHARACTER(LEN=3),
PARAMETER :: yinit =
'ALL'
201 CHARACTER(LEN=28) :: yluout =
'LISTING_OFFLINE '
210 INTEGER :: imonth_out
214 INTEGER,
DIMENSION(11) :: idatef
216 CHARACTER(LEN=28),
PARAMETER :: yatmfile =
' '
217 CHARACTER(LEN=6),
PARAMETER :: yatmfiletype =
' '
218 CHARACTER(LEN=2),
PARAMETER :: ytest =
'OK'
220 REAL,
DIMENSION(:),
POINTER :: zlat
221 REAL,
DIMENSION(:),
POINTER :: zlon
222 REAL,
DIMENSION(:),
POINTER :: zzs_forc
223 REAL,
DIMENSION(:),
POINTER :: zzref
224 REAL,
DIMENSION(:),
POINTER :: zuref
231 INTEGER :: inb_step_atm
237 INTEGER :: jforc_step
238 INTEGER :: jsurf_step
242 REAL,
DIMENSION(:,:),
ALLOCATABLE :: zta
243 REAL,
DIMENSION(:,:),
ALLOCATABLE :: zqa
244 REAL,
DIMENSION(:,:),
ALLOCATABLE :: zwind
245 REAL,
DIMENSION(:,:),
ALLOCATABLE :: zsca_sw
246 REAL,
DIMENSION(:,:),
ALLOCATABLE :: zdir_sw
247 REAL,
DIMENSION(:,:),
ALLOCATABLE :: zlw
248 REAL,
DIMENSION(:,:),
ALLOCATABLE :: zsnow
249 REAL,
DIMENSION(:,:),
ALLOCATABLE :: zrain
250 REAL,
DIMENSION(:,:),
ALLOCATABLE :: zps
251 REAL,
DIMENSION(:,:),
ALLOCATABLE :: zco2
252 REAL,
DIMENSION(:,:),
ALLOCATABLE :: zdir
258 CHARACTER(LEN=14) :: ytag
261 REAL,
DIMENSION(:),
ALLOCATABLE :: zsw
262 REAL,
DIMENSION(:),
ALLOCATABLE :: zcoef
266 INTEGER :: i2m, ibeq, idsteq
267 LOGICAL :: gfrac, gdiag_grid, gsurf_budget, grad_budget, gcoef, &
268 gsurf_vars, gdiag_ocean, gdiag_seaice, gwater_profile, &
269 ginterpol_ts, gsurf_evap_budget, gflood, gpgd_isba, &
270 gch_no_flux_isba, gsurf_misc_budget_isba, gpgd_teb, &
271 gsurf_misc_budget_teb
275 REAL,
DIMENSION(:),
ALLOCATABLE :: zsea, zwater, znature, ztown
276 REAL,
DIMENSION(:),
ALLOCATABLE :: zsea_full, zwater_full, znature_full, ztown_full
277 REAL,
DIMENSION(:),
ALLOCATABLE :: zt2m, zq2m
278 REAL,
DIMENSION(:),
ALLOCATABLE :: zz0, zz0h, zqs
279 REAL,
DIMENSION(:),
ALLOCATABLE :: zqs_sea, zqs_water, zqs_nature, zqs_town
280 REAL,
DIMENSION(:),
ALLOCATABLE :: zpsng, zpsnv
281 REAL,
DIMENSION(:),
ALLOCATABLE :: zz0eff
282 REAL,
DIMENSION(:),
ALLOCATABLE :: zzs
283 REAL,
DIMENSION(:),
ALLOCATABLE :: zz0_full, zz0eff_full, zzs_full
284 INTEGER :: iseries, isize
288 CHARACTER(LEN=100) :: yname
289 CHARACTER(LEN=10) :: yrank
290 INTEGER :: ilevel, infompi, j, inkproma, jblock
291 INTEGER,
DIMENSION(:),
ALLOCATABLE :: isize_omp
292 REAL :: xtime0, xtime1, xtime
296 INTEGER :: ilocal_comm
298 REAL(KIND=JPRB) :: zhook_handle
316 CALL mpi_init_thread(mpi_thread_multiple,ilevel,infompi)
317 IF (infompi /= mpi_success)
THEN
318 CALL
abor1_sfx(
'OFFLINE: ERROR WHEN INITIALIZING MPI')
323 IF (lhook) CALL dr_hook(
'OFFLINE',0,zhook_handle)
333 CALL mpi_comm_size(ncomm,nproc,infompi)
334 CALL mpi_comm_rank(ncomm,nrank,infompi)
347 CALL
wlog_mpi(
'NBLOCKTOT ',klog=nblocktot)
356 WRITE(yrank,fmt=
'(I10)') nrank
357 yname=trim(yluout)//adjustl(yrank)
359 cluout_lfi = adjustl(adjustr(yname)//
'.txt')
360 cluout_nc = adjustl(adjustr(yname)//
'.txt')
363 OPEN(unit=iluout,file=adjustl(adjustr(yname)//
'.txt'),form=
'FORMATTED',action=
'WRITE')
366 IF ( nrank==npio )
THEN
371 IF(nblocktot==1)
THEN
387 CALL
posnam(ilunam,
'NAM_IO_OFFLINE',gfound,iluout)
388 IF (gfound)
READ (unit=ilunam,nml=nam_io_offline)
394 xio_frac = max(min(xio_frac,1.),0.)
397 CALL
test_nam_var_surf(iluout,
'CSURF_FILETYPE',csurf_filetype,
'ASCII ',
'LFI ',
'FA ',
'NC ')
398 CALL
test_nam_var_surf(iluout,
'CTIMESERIES_FILETYPE',ctimeseries_filetype,
'NETCDF',
'TEXTE ',
'BINARY',&
399 'ASCII ',
'LFI ',
'FA ',&
400 'NONE ',
'OFFLIN',
'NC ')
401 CALL
test_nam_var_surf(iluout,
'CFORCING_FILETYPE',cforcing_filetype,
'NETCDF',
'ASCII ',
'BINARY')
403 IF (nscal>59) CALL
abor1_sfx(
"OFFLINE: NSCAL MUST BE LOWER THAN OR EQUAL TO 59")
406 IF (ctimeseries_filetype==
'NETCDF') ctimeseries_filetype=
'OFFLIN'
408 IF (nrank==npio)
THEN
410 cfilepgd = adjustl(adjustr(cpgdfile)//
'.txt')
411 cfilein = adjustl(adjustr(cprepfile)//
'.txt')
412 cfilein_save = cfilein
414 cfilepgd_lfi = cpgdfile
415 cfilein_lfi = cprepfile
416 cfilein_lfi_save = cfilein_lfi
418 cfilepgd_fa = adjustl(adjustr(cpgdfile)//
'.fa')
419 cfilein_fa = adjustl(adjustr(cprepfile)//
'.fa')
420 cfilein_fa_save = cfilein_fa
422 cfilepgd_nc = adjustl(adjustr(cpgdfile)//
'.nc')
423 cfilein_nc = adjustl(adjustr(cprepfile)//
'.nc')
424 cfilein_nc_save = cfilein_nc
430 ysurf_cur => ysurf_list(1)
434 csurf_filetype,
'ALL',.false.)
443 cprogname = csurf_filetype
451 IF (nrank==npio)
THEN
459 ldefined_surf_atm = .false.
460 ldefined_nature = .false.
461 ldefined_town = .false.
462 ldefined_water = .false.
463 ldefined_sea = .false.
468 xtime = (mpi_wtime() - xtime0)
470 CALL
wlog_mpi(
'READ NAMELISTS ',plog=xtime)
477 IF (cforcing_filetype==
'ASCII ' .OR. cforcing_filetype==
'BINARY') CALL
open_close_bin_asc_forc(
'CONF ',cforcing_filetype,
'R')
483 gshadows = lshadows_slope .OR. lshadows_other
485 csurf_filetype, yalg_mpi, xio_frac, gshadows)
488 CALL
wlog_mpi(
'TIME_NPIO_READ init_index ',plog=xtime_npio_read)
489 CALL
wlog_mpi(
'TIME_COMM_READ init_index ',plog=xtime_comm_read)
494 xtime = (mpi_wtime() - xtime0)
497 CALL
wlog_mpi(
'INIT_INDEX_MPI ',plog=xtime)
506 csurf_filetype, cforcing_filetype, &
507 zduration, ztstep, ini, iyear, imonth, iday, &
508 ztime, zlat, zlon, zzs_forc, zzref, zuref )
511 CALL
wlog_mpi(
'TIME_NPIO_READ forc conf ',plog=xtime_npio_read)
512 CALL
wlog_mpi(
'TIME_COMM_READ forc conf ',plog=xtime_comm_read)
517 xtime = (mpi_wtime() - xtime0)
519 CALL
wlog_mpi(
'OL_READ_ATM_CONF ',plog=xtime)
527 IF ( (mod(xtstep_output,ztstep)*mod(ztstep,xtstep_output) /= 0) .OR. (mod(ztstep,xtstep_surf) /= 0) )
THEN
528 WRITE(iluout,*)
' FORCING AND OUTPUT/SURFACE TIME STEP SHOULD BE MULTIPLE', &
529 nint(ztstep),nint(xtstep_output),nint(xtstep_surf)
530 CALL
abor1_sfx(
'OFFLINE: FORCING AND OUTPUT/SURFACE TIME STEP SHOULD BE MULTIPLE')
533 IF ( ztime /= 0. .AND. mod(ztime,xtstep_surf) /= 0 )
THEN
534 WRITE(iluout,*)
' INITIAL AND SURFACE TIME STEP SHOULD BE MULTIPLE', &
535 nint(ztime),nint(xtstep_surf)
536 CALL
abor1_sfx(
'OFFLINE: INITIAL AND SURFACE TIME STEP SHOULD BE MULTIPLE')
539 IF(loasis.AND.zduration/=xruntime)
THEN
540 WRITE(iluout,*)
'Total simulated time given by Forcing field and OASIS namcouple are different'
541 WRITE(iluout,*)
'From Forcing (s) : ',zduration,
'From OASIS (s) : ',xruntime
542 CALL
abor1_sfx(
'OFFLINE: TOTAL SIMULATED TIME DIFFERENT BETWEEN FORCING AND OASIS')
545 inb_step_atm = int(zduration / ztstep)
546 inb_atm = int(ztstep / xtstep_surf)
547 nstep_output = int(zduration / xtstep_output)
552 IF ( lcoupl_topd )
THEN
554 xtopd_step = float(nnb_topd)* xtstep_surf
555 nnb_topd_step = int( zduration / xtopd_step )
557 IF ( nnb_stp_restart==0 .AND. .NOT.lrestart ) nnb_stp_restart = -1
576 csurf_filetype, lset_forc_zs, xdelta_orog)
583 ALLOCATE(isize_omp(0:nblocktot-1))
585 nblocktot,ini,0,isize_omp, gshadows)
586 CALL
sunpos(isize_omp, iyear, imonth, iday, ztime, zlon, zlat, xtsun, xzenith, xazim)
587 DEALLOCATE(isize_omp)
591 IF (nb_read_forc.EQ.1)
THEN
592 inb_lines=inb_step_atm
593 ELSEIF (nb_read_forc.NE.0)
THEN
595 inb_lines=ceiling(1.*(inb_step_atm+1)/nb_read_forc)
600 nb_read_forc=ceiling(1.*(inb_step_atm+1)/inb_lines)
605 #if ! defined in_arpege
611 IF (.NOT.
ALLOCATED(zta))
ALLOCATE(zta(ini,inb_lines+1))
612 IF (.NOT.
ALLOCATED(zqa))
ALLOCATE(zqa(ini,inb_lines+1))
613 IF (.NOT.
ALLOCATED(zwind))
ALLOCATE(zwind(ini,inb_lines+1))
614 IF (.NOT.
ALLOCATED(zdir_sw))
ALLOCATE(zdir_sw(ini,inb_lines+1))
615 IF (.NOT.
ALLOCATED(zsca_sw))
ALLOCATE(zsca_sw(ini,inb_lines+1))
616 IF (.NOT.
ALLOCATED(zlw))
ALLOCATE(zlw(ini,inb_lines+1))
617 IF (.NOT.
ALLOCATED(zsnow))
ALLOCATE(zsnow(ini,inb_lines+1))
618 IF (.NOT.
ALLOCATED(zrain))
ALLOCATE(zrain(ini,inb_lines+1))
619 IF (.NOT.
ALLOCATED(zps))
ALLOCATE(zps(ini,inb_lines+1))
620 IF (.NOT.
ALLOCATED(zco2))
ALLOCATE(zco2(ini,inb_lines+1))
621 IF (.NOT.
ALLOCATED(zdir))
ALLOCATE(zdir(ini,inb_lines+1))
622 IF (.NOT.
ALLOCATED(zcoef))
ALLOCATE(zcoef(ini))
624 IF (.NOT.
ALLOCATED(zsw))
ALLOCATE(zsw(ini))
629 xtime = (mpi_wtime() - xtime0)
631 CALL
wlog_mpi(
'COMPARE_OROGRAPHY SUNPOS ',plog=xtime)
638 IF (cforcing_filetype==
'ASCII ' .OR. cforcing_filetype==
'BINARY') CALL
open_close_bin_asc_forc(
'OPEN ',cforcing_filetype,
'R')
641 csurf_filetype, cforcing_filetype, 1, &
642 zta,zqa,zwind,zdir_sw,zsca_sw,zlw,zsnow,zrain,zps,&
643 zco2,zdir,llimit_qair )
646 CALL
wlog_mpi(
'TIME_NPIO_READ forc ',plog=xtime_npio_read)
647 CALL
wlog_mpi(
'TIME_COMM_READ forc ',plog=xtime_comm_read)
652 xtime = (mpi_wtime() - xtime0)
655 CALL
wlog_mpi(
'OL_READ_ATM0 ',plog=xtime)
662 xrhoa(:) = zps(:,1) / (xrd * zta(:,1) * ( 1.+((xrv/xrd)-1.)*zqa(:,1) ) + xg * xzref )
667 xtime = (mpi_wtime() - xtime0)
669 CALL
wlog_mpi(
'CO2 RHOA ',plog=xtime)
677 ALLOCATE(isize_omp(0:nblocktot-1))
679 nblocktot,ini,0,isize_omp, gshadows)
681 CALL
wlog_mpi(
"SIZES_OMP ",klog=j,klog2=isize_omp(j))
692 IF (nblock==nblocktot)
THEN
693 CALL
init_dim(isize_omp,0,inkproma,nindx1sfx,nindx2sfx)
695 CALL
init_dim(isize_omp,nblock,inkproma,nindx1sfx,nindx2sfx)
705 csurf_filetype, yinit, lland_use, &
706 inkproma, nscal, ibands, &
707 csv,xco2(nindx1sfx:nindx2sfx),xrhoa(nindx1sfx:nindx2sfx), &
708 xzenith(nindx1sfx:nindx2sfx),xazim(nindx1sfx:nindx2sfx),xsw_bands, &
709 xdir_alb(nindx1sfx:nindx2sfx,:), xsca_alb(nindx1sfx:nindx2sfx,:), &
710 xemis(nindx1sfx:nindx2sfx), xtsrad(nindx1sfx:nindx2sfx), &
711 xtsurf(nindx1sfx:nindx2sfx), &
712 iyear, imonth, iday, ztime, &
713 yatmfile, yatmfiletype, ytest )
725 CALL
reset_dim(ini,inkproma,nindx1sfx,nindx2sfx)
728 xtime = (mpi_wtime() - xtime0)
731 CALL
wlog_mpi(
'INIT_SURF_ATM ',plog=xtime)
734 CALL
wlog_mpi(
'TIME_NPIO_READ init ',plog=xtime_npio_read)
735 CALL
wlog_mpi(
'TIME_COMM_READ init ',plog=xtime_comm_read)
746 csurf_filetype,yinit,lland_use, &
747 ini, nscal, ibands, &
748 csv,xco2(nindx1sfx:nindx2sfx),xrhoa(nindx1sfx:nindx2sfx), &
749 xzenith(nindx1sfx:nindx2sfx),xazim(nindx1sfx:nindx2sfx), &
750 xsw_bands,xdir_alb(nindx1sfx:nindx2sfx,:), &
751 xsca_alb(nindx1sfx:nindx2sfx,:), &
752 xemis(nindx1sfx:nindx2sfx),xtsrad(nindx1sfx:nindx2sfx), &
753 xtsurf(nindx1sfx:nindx2sfx), &
754 iyear, imonth, iday, ztime, &
755 yatmfile, yatmfiletype, ytest )
768 csurf_filetype,yalg_mpi)
771 IF (ctimeseries_filetype==
"OFFLIN")
THEN
778 IF (ctimeseries_filetype==
"NC ") inw = 2
783 xtime = (mpi_wtime() - xtime0)
785 CALL
wlog_mpi(
'INIT FINISHED ',plog=xtime)
794 DO jforc_step=1,inb_step_atm
802 id_forc=jforc_step-int(jforc_step/inb_lines)*inb_lines
803 IF (id_forc==0) id_forc=inb_lines
805 IF (id_forc==1 .AND. jforc_step.NE.1)
THEN
808 IF (jforc_step/inb_lines==nb_read_forc-1)
THEN
809 idmax=inb_step_atm-jforc_step+1+1
811 zta(:,idmax)=zta(:,
SIZE(zta,2))
812 zqa(:,idmax)=zqa(:,
SIZE(zta,2))
813 zwind(:,idmax)=zwind(:,
SIZE(zta,2))
814 zdir_sw(:,idmax)=zdir_sw(:,
SIZE(zta,2))
815 zsca_sw(:,idmax)=zsca_sw(:,
SIZE(zta,2))
816 zlw(:,idmax)=zlw(:,
SIZE(zta,2))
817 zsnow(:,idmax)=zsnow(:,
SIZE(zta,2))
818 zrain(:,idmax)=zrain(:,
SIZE(zta,2))
819 zps(:,idmax)=zps(:,
SIZE(zta,2))
820 zco2(:,idmax)=zco2(:,
SIZE(zta,2))
821 zdir(:,idmax)=zdir(:,
SIZE(zta,2))
824 csurf_filetype, cforcing_filetype, jforc_step, &
825 zta(:,1:idmax),zqa(:,1:idmax),zwind(:,1:idmax), &
826 zdir_sw(:,1:idmax),zsca_sw(:,1:idmax),zlw(:,1:idmax), &
827 zsnow(:,1:idmax),zrain(:,1:idmax),zps(:,1:idmax),&
828 zco2(:,1:idmax),zdir(:,1:idmax),llimit_qair )
832 xtime_calc(1) = xtime_calc(1) + (mpi_wtime() - xtime1)
836 DO jsurf_step=1,inb_atm
843 CALL
sunpos(isize_omp, iyear, imonth, iday, ztime, &
844 zlon, zlat, xtsun, xzenith, xazim)
845 CALL
sunpos(isize_omp, iyear, imonth, iday, ztime+xtstep_surf, &
846 zlon, zlat, xtsun, xzenith2, xazim)
848 xtime_calc(2) = xtime_calc(2) + (mpi_wtime() - xtime1)
853 zta(:,id_forc),zta(:,id_forc+1), &
854 zqa(:,id_forc),zqa(:,id_forc+1), &
855 zwind(:,id_forc),zwind(:,id_forc+1), &
856 zdir_sw(:,id_forc),zdir_sw(:,id_forc+1), &
857 zsca_sw(:,id_forc),zsca_sw(:,id_forc+1), &
858 zlw(:,id_forc),zlw(:,id_forc+1), &
859 zsnow(:,id_forc+1),zrain(:,id_forc+1), &
860 zps(:,id_forc),zps(:,id_forc+1), &
861 zco2(:,id_forc), zco2(:,id_forc+1), &
862 zdir(:,id_forc) ,zdir(:,id_forc+1) )
864 xtime_calc(3) = xtime_calc(3) + (mpi_wtime() - xtime1)
877 zcoef(:) = (xpi/2. - xzenith(:) - 0.05) / 0.05
878 zcoef(:) = max(min(zcoef,1.),0.)
879 DO jloop=1,
SIZE(xdir_sw,2)
880 xsca_sw(:,jloop) = xsca_sw(:,jloop) + xdir_sw(:,jloop) * (1 - zcoef)
881 xdir_sw(:,jloop) = xdir_sw(:,jloop) * zcoef(:)
887 DO jloop=1,
SIZE(xdir_sw,2)
888 zsw(:) = zsw(:) + xdir_sw(:,jloop) + xsca_sw(:,jloop)
891 xzenith = min(xzenith ,xpi/2.-0.01)
892 xzenith2 = min(xzenith2,xpi/2.-0.01)
894 xzenith = max(xzenith ,xpi/2.)
895 xzenith2 = max(xzenith2,xpi/2.)
901 ztimec= ztimec+xtstep_surf
902 IF (lcoupl_topd) ltopd_step = ( mod((((jforc_step-1)*inb_atm)+jsurf_step),nnb_topd) == 0 )
907 xtime_calc(4) = xtime_calc(4) + (mpi_wtime() - xtime1)
914 CALL
sfx_oasis_recv_ol(ysurf_cur%FM%F, ysurf_cur%IM%I, ysurf_cur%SM%S, ysurf_cur%U, ysurf_cur%WM%W, &
915 csurf_filetype,ini,ibands,ztimec, &
916 xtstep_surf,isize_omp,xzenith,xsw_bands,&
917 xtsrad,xdir_alb,xsca_alb,xemis,xtsurf )
928 IF (nblock==nblocktot)
THEN
929 CALL
init_dim(isize_omp,0,inkproma,nindx1sfx,nindx2sfx)
931 CALL
init_dim(isize_omp,nblock,inkproma,nindx1sfx,nindx2sfx)
942 xazim(nindx1sfx:nindx2sfx),xps(nindx1sfx:nindx2sfx),xta(nindx1sfx:nindx2sfx),&
943 xrain(nindx1sfx:nindx2sfx),xdir_sw(nindx1sfx:nindx2sfx,:),xlw(nindx1sfx:nindx2sfx),&
944 xzs_thread,xzs_xy_thread, xslopang_thread,xslopazi_thread,xsurf_triangle_thread)
948 csurf_filetype,
'E', ztimec, &
949 xtstep_surf, iyear, imonth, iday, ztime, inkproma, nscal, ibands, &
950 xtsun(nindx1sfx:nindx2sfx), xzenith(nindx1sfx:nindx2sfx), &
951 xzenith2(nindx1sfx:nindx2sfx), xazim(nindx1sfx:nindx2sfx), &
952 xzref(nindx1sfx:nindx2sfx), xuref(nindx1sfx:nindx2sfx), &
953 xzs(nindx1sfx:nindx2sfx), xu(nindx1sfx:nindx2sfx), &
954 xv(nindx1sfx:nindx2sfx), xqa(nindx1sfx:nindx2sfx), &
955 xta(nindx1sfx:nindx2sfx), xrhoa(nindx1sfx:nindx2sfx), &
956 xsv(nindx1sfx:nindx2sfx,:), xco2(nindx1sfx:nindx2sfx), csv, &
957 xrain(nindx1sfx:nindx2sfx), xsnow(nindx1sfx:nindx2sfx), &
958 xlw(nindx1sfx:nindx2sfx), xdir_sw(nindx1sfx:nindx2sfx,:), &
959 xsca_sw(nindx1sfx:nindx2sfx,:), xsw_bands, xps(nindx1sfx:nindx2sfx),&
960 xpa(nindx1sfx:nindx2sfx), xsftq(nindx1sfx:nindx2sfx), &
961 xsfth(nindx1sfx:nindx2sfx), xsfts(nindx1sfx:nindx2sfx,:), &
962 xsfco2(nindx1sfx:nindx2sfx), xsfu(nindx1sfx:nindx2sfx), &
963 xsfv(nindx1sfx:nindx2sfx), xtsrad(nindx1sfx:nindx2sfx), &
964 xdir_alb(nindx1sfx:nindx2sfx,:), xsca_alb(nindx1sfx:nindx2sfx,:), &
965 xemis(nindx1sfx:nindx2sfx), &
966 xtsurf(nindx1sfx:nindx2sfx), xz0(nindx1sfx:nindx2sfx), &
967 xz0h(nindx1sfx:nindx2sfx), xqsurf(nindx1sfx:nindx2sfx), &
968 xpew_a_coef(nindx1sfx:nindx2sfx),xpew_b_coef(nindx1sfx:nindx2sfx),&
969 xpet_a_coef(nindx1sfx:nindx2sfx),xpeq_a_coef(nindx1sfx:nindx2sfx),&
970 xpet_b_coef(nindx1sfx:nindx2sfx),xpeq_b_coef(nindx1sfx:nindx2sfx),&
973 CALL
reset_dim(ini,inkproma,nindx1sfx,nindx2sfx)
976 xtime_calc(5) = xtime_calc(5) + (mpi_wtime() - xtime1)
987 CALL
sfx_oasis_send_ol(ysurf_cur%FM%F, ysurf_cur%IM%I, ysurf_cur%SM%S, ysurf_cur%U, ysurf_cur%WM%W, &
988 csurf_filetype,ini,ztimec,xtstep_surf,isize_omp)
991 ztime = ztime + xtstep_surf
994 xtime_calc(6) = xtime_calc(6) + (mpi_wtime() - xtime1)
1000 IF ( lcoupl_topd .AND. ltopd_step )
THEN
1002 IF (.NOT.
ALLOCATED(nyear))
ALLOCATE(nyear(nnb_topd_step))
1003 IF (.NOT.
ALLOCATED(nmonth))
ALLOCATE(nmonth(nnb_topd_step))
1004 IF (.NOT.
ALLOCATED(nday))
ALLOCATE(nday(nnb_topd_step))
1005 IF (.NOT.
ALLOCATED(nh))
ALLOCATE(nh(nnb_topd_step))
1006 IF (.NOT.
ALLOCATED(nm))
ALLOCATE(nm(nnb_topd_step))
1008 nyear(ntopd_step) = iyear
1009 nmonth(ntopd_step) = imonth
1010 nday(ntopd_step) = iday
1011 nh(ntopd_step) = int(ztime/3600.)
1012 nm(ntopd_step) = int((ztime-nh(ntopd_step)*3600.)/60.)
1014 IF ( nm(ntopd_step)==60 )
THEN
1017 nh(ntopd_step) = nh(ntopd_step)+1
1021 IF ( nh(ntopd_step)==24 )
THEN
1024 nday(ntopd_step) = nday(ntopd_step)+1
1027 SELECT CASE (nmonth(ntopd_step))
1029 IF ( nday(ntopd_step)==31 )
THEN
1030 nmonth(ntopd_step) = nmonth(ntopd_step)+1
1031 nday(ntopd_step) = 1
1034 IF ( nday(ntopd_step)==32 )
THEN
1035 nmonth(ntopd_step) = nmonth(ntopd_step)+1
1036 nday(ntopd_step) = 1
1039 IF ( nday(ntopd_step)==32 )
THEN
1040 nyear(ntopd_step) = nyear(ntopd_step)+1
1041 nmonth(ntopd_step) = 1
1042 nday(ntopd_step) = 1
1045 IF( mod(nyear(ntopd_step),4)==0 .AND. mod(nyear(ntopd_step),100)/=0 .OR. mod(nyear(ntopd_step),400)==0 )
THEN
1046 IF (nday(ntopd_step)==30)
THEN
1047 nmonth(ntopd_step) = nmonth(ntopd_step)+1
1048 nday(ntopd_step) = 1
1051 IF (nday(ntopd_step)==29)
THEN
1052 nmonth(ntopd_step) = nmonth(ntopd_step)+1
1053 nday(ntopd_step) = 1
1062 ntopd_step = ntopd_step + 1
1066 IF (mod(ztimec,xtstep_output) == 0. .AND. ctimeseries_filetype/=
'NONE ')
THEN
1068 IF (nrank==npio)
THEN
1071 IF (ctimeseries_filetype==
"ASCII " .OR. &
1072 ctimeseries_filetype==
"LFI " .OR. &
1073 ctimeseries_filetype==
"FA " .OR. &
1074 ctimeseries_filetype==
"NC " )
THEN
1082 IF(lout_timename)
THEN
1089 imonth_out = imonth - 1
1090 IF(imonth_out==0)
THEN
1092 iyear_out = iyear - 1
1094 SELECT CASE (imonth_out)
1097 CASE(1,3,5,7:8,10,12)
1100 IF( ((mod(iyear_out,4)==0).AND.(mod(iyear_out,100)/=0)) .OR. (mod(iyear_out,400)==0))
THEN
1111 WRITE(ytag,fmt=
'(I4.4,I2.2,I2.2,A1,I2.2,A1,I2.2)') iyear_out,imonth_out,iday_out,&
1112 '_',int(ztime_out/3600.),
'h',nint(ztime_out)/60-60*int(ztime_out/3600.)
1113 cfileout = adjustl(adjustr(csurffile)//
'.'//ytag//
'.txt')
1114 cfileout_lfi= adjustl(adjustr(csurffile)//
'.'//ytag)
1115 cfileout_fa = adjustl(adjustr(csurffile)//
'.'//ytag//
'.fa')
1116 cfileout_nc = adjustl(adjustr(csurffile)//
'.'//ytag//
'.nc')
1118 IF (ctimeseries_filetype==
'FA ')
THEN
1120 lfanocompact = ldiag_fa_nocompact
1125 idatef(4)= floor(ztime/3600.)
1126 idatef(5)= floor(ztime/60.) - idatef(4) * 60
1127 idatef(6)= nint(ztime) - idatef(4) * 3600 - idatef(5) * 60
1129 IF (csurf_filetype/=
'FA ')
THEN
1131 csurf_filetype,
'ALL')
1133 CALL faitou(iret,nunit_fa,.true.,cfileout_fa,
'UNKNOWN',.true.,.false.,iverbfa,0,inb,cdnomc)
1135 CALL fandar(iret,nunit_fa,idatef)
1141 xstartw = xstartw + 1
1143 ltime_written(:)=.false.
1148 xtime_write(1) = xtime_write(1) + (mpi_wtime() - xtime1)
1153 IF (ctimeseries_filetype==
"NC ")
THEN
1155 CALL
init_output_nc_n(ysurf_cur%TM%BDD, ysurf_cur%CHE, ysurf_cur%CHN, ysurf_cur%CHU, &
1156 ysurf_cur%SM%DTS, ysurf_cur%TM%DTT, ysurf_cur%DTZ, ysurf_cur%IM%I, &
1157 ysurf_cur%UG, ysurf_cur%U, ysurf_cur%DGU)
1170 IF (nblock==nblocktot)
THEN
1171 CALL
init_dim(isize_omp,0,inkproma,nindx1sfx,nindx2sfx)
1173 CALL
init_dim(isize_omp,nblock,inkproma,nindx1sfx,nindx2sfx)
1183 xtime1 = mpi_wtime()
1186 ctimeseries_filetype,
'ALL',lland_use)
1188 xtime_write(2) = xtime_write(2) + (mpi_wtime() - xtime1)
1189 xtime1 = mpi_wtime()
1191 CALL
diag_surf_atm_n(ysurf_cur%IM%DGEI, ysurf_cur%FM%DGF, ysurf_cur%DGL, ysurf_cur%IM%DGI, &
1192 ysurf_cur%SM%DGS, ysurf_cur%DGU, ysurf_cur%TM%DGT, ysurf_cur%WM%DGW, &
1193 ysurf_cur%U, ysurf_cur%USS, &
1194 ctimeseries_filetype)
1196 xtime_write(3) = xtime_write(3) + (mpi_wtime() - xtime1)
1197 xtime1 = mpi_wtime()
1200 ctimeseries_filetype,
'ALL')
1202 xtime_write(4) = xtime_write(4) + (mpi_wtime() - xtime1)
1205 CALL
reset_dim(ini,inkproma,nindx1sfx,nindx2sfx)
1215 IF (lcoupl_topd .AND. ntopd_step > nnb_topd_step)
THEN
1219 nyear,nmonth,nday,nh,nm,xqtot)
1221 nyear,nmonth,nday,nh,nm,xqb_run)
1223 nyear,nmonth,nday,nh,nm,xqb_dr)
1230 xtime1 = mpi_wtime()
1233 IF (nrank==npio)
THEN
1234 IF (ctimeseries_filetype==
'FA ')
THEN
1236 CALL fairme(iret,nunit_fa,
'UNKNOWN')
1240 IF (ctimeseries_filetype==
'LFI ' .AND. lmnh_compatible) CALL
write_header_mnh
1243 xtime_write(5) = xtime_write(5) + (mpi_wtime() - xtime1)
1251 IF (nrank==npio)
THEN
1253 IF (mod(ztimec,xday) == 0.)
THEN
1256 CALL
wlog_mpi(
'SFX DAY :',klog=icount,klog2=int(zduration/xday))
1257 WRITE(*,
'(A10,I5,A2,I5)')
'SFX DAY :',icount,
' /',int(zduration/xday)
1268 xtime = (mpi_wtime() - xtime0)
1272 CALL
wlog_mpi(
'OL_READ_ATM ',plog=xtime_calc(1))
1273 CALL
wlog_mpi(
'SUNPOS ',plog=xtime_calc(2))
1274 CALL
wlog_mpi(
'OL_TIME_INTERP_ATM ',plog=xtime_calc(3))
1276 CALL
wlog_mpi(
'ZENITH ',plog=xtime_calc(4))
1278 CALL
wlog_mpi(
'COUPLING_SURF_ATM ',plog=xtime_calc(5))
1280 CALL
wlog_mpi(
'ADD_FORECAST_TO_DATE_SURF ',plog=xtime_calc(6))
1281 CALL
wlog_mpi(
'DEF_DATE ',plog=xtime_write(1))
1283 CALL
wlog_mpi(
'WRITE_SURF_ATM ',plog=xtime_write(2))
1284 CALL
wlog_mpi(
'DIAG_SURF_ATM ',plog=xtime_write(3))
1285 CALL
wlog_mpi(
'WRITE_DIAG_SURF_ATM ',plog=xtime_write(4))
1287 CALL
wlog_mpi(
'CLOSE FILES ',plog=xtime_write(5))
1289 CALL
wlog_mpi(
'END LOOP ',plog=xtime)
1291 CALL
wlog_mpi(
'TIME_NPIO_WRITE ',plog=xtime_npio_write)
1292 CALL
wlog_mpi(
'TIME_COMM_WRITE ',plog=xtime_comm_write)
1293 CALL
wlog_mpi(
'TIME_OMP_BARR ',plog=xtime_omp_barr)
1294 CALL
wlog_mpi(
'TIME_CALC_WRITE ',plog=xtime_calc_write)
1296 CALL
wlog_mpi(
'TIME_INIT_SEA ',plog=xtime_init_sea)
1297 CALL
wlog_mpi(
'TIME_INIT_WATER ',plog=xtime_init_water)
1298 CALL
wlog_mpi(
'TIME_INIT_NATURE ',plog=xtime_init_nature)
1299 CALL
wlog_mpi(
'TIME_INIT_TOWN ',plog=xtime_init_town)
1301 CALL
wlog_mpi(
'TIME_SEA ',plog=xtime_sea)
1302 CALL
wlog_mpi(
'TIME_WATER ',plog=xtime_water)
1303 CALL
wlog_mpi(
'TIME_NATURE ',plog=xtime_nature)
1304 CALL
wlog_mpi(
'TIME_TOWN ',plog=xtime_town)
1309 IF (cforcing_filetype==
'ASCII ' .OR. cforcing_filetype==
'BINARY') CALL
open_close_bin_asc_forc(
'CLOSE',cforcing_filetype,
'R')
1319 IF ( lrestart )
THEN
1321 IF (nrank==npio)
THEN
1323 cfileout = adjustl(adjustr(csurffile)//
'.txt')
1324 cfileout_lfi= csurffile
1325 cfileout_fa = adjustl(adjustr(csurffile)//
'.fa')
1326 cfileout_nc = adjustl(adjustr(csurffile)//
'.nc')
1329 IF (csurf_filetype==
'FA ')
THEN
1331 lfanocompact = .true.
1335 idatef(4)= floor(ztime/3600.)
1336 idatef(5)= floor(ztime/60.) - idatef(4) * 60
1337 idatef(6)= nint(ztime) - idatef(4) * 3600 - idatef(5) * 60
1339 CALL faitou(iret,nunit_fa,.true.,cfileout_fa,
'UNKNOWN',.true.,.false.,iverbfa,0,inb,cdnomc)
1340 CALL fandar(iret,nunit_fa,idatef)
1347 IF (csurf_filetype==
"NC ") inw = 2
1351 IF (csurf_filetype==
"NC ")
THEN
1353 CALL
init_output_nc_n(ysurf_cur%TM%BDD, ysurf_cur%CHE, ysurf_cur%CHN, ysurf_cur%CHU, &
1354 ysurf_cur%SM%DTS, ysurf_cur%TM%DTT, ysurf_cur%DTZ, ysurf_cur%IM%I, &
1355 ysurf_cur%UG, ysurf_cur%U, ysurf_cur%DGU)
1366 IF (nblock==nblocktot)
THEN
1367 CALL
init_dim(isize_omp,0,inkproma,nindx1sfx,nindx2sfx)
1369 CALL
init_dim(isize_omp,nblock,inkproma,nindx1sfx,nindx2sfx)
1378 CALL
flag_update(ysurf_cur%IM%DGI, ysurf_cur%DGU, &
1379 .false.,.true.,.false.,.false.)
1381 IF (lrestart_2m)
THEN
1390 gsurf_budget = .false.
1391 grad_budget = .false.
1393 gsurf_vars = .false.
1396 gdiag_ocean = .false.
1397 gdiag_seaice = .false.
1398 gwater_profile = .false.
1399 gsurf_evap_budget = .false.
1401 gch_no_flux_isba = .false.
1402 gsurf_misc_budget_isba = .false.
1404 gsurf_misc_budget_teb = .false.
1406 CALL
flag_diag_update(ysurf_cur%FM%CHF, ysurf_cur%IM%CHI, ysurf_cur%SM%CHS, ysurf_cur%TM%CHT, &
1407 ysurf_cur%WM%CHW, ysurf_cur%IM%DGEI, ysurf_cur%FM%DGF, ysurf_cur%IM%DGI, &
1408 ysurf_cur%FM%DGMF, ysurf_cur%IM%DGMI, ysurf_cur%TM%DGMTO, ysurf_cur%SM%DGO, &
1409 ysurf_cur%SM%DGS, ysurf_cur%SM%DGSI, ysurf_cur%DGU, ysurf_cur%TM%DGT, &
1410 ysurf_cur%WM%DGW, ysurf_cur%IM%I, ysurf_cur%U, &
1411 gfrac, gdiag_grid, i2m, gsurf_budget, grad_budget, gcoef, &
1412 gsurf_vars, ibeq, idsteq, gdiag_ocean, gdiag_seaice, &
1414 gsurf_evap_budget, gflood, gpgd_isba, gch_no_flux_isba, &
1415 gsurf_misc_budget_isba, gpgd_teb, gsurf_misc_budget_teb )
1419 csurf_filetype,
'ALL',lland_use)
1420 IF(csurf_filetype/=
'FA ' .OR. lrestart_2m)
THEN
1422 csurf_filetype,
'ALL')
1425 CALL
reset_dim(ini,inkproma,nindx1sfx,nindx2sfx)
1435 IF (csurf_filetype==
'FA ')
THEN
1437 CALL fairme(iret,nunit_fa,
'UNKNOWN')
1455 IF ( linquire )
THEN
1463 IF (nblock==nblocktot)
THEN
1464 CALL
init_dim(isize_omp,0,inkproma,nindx1sfx,nindx2sfx)
1466 CALL
init_dim(isize_omp,nblock,inkproma,nindx1sfx,nindx2sfx)
1468 ini = nindx2sfx-nindx1sfx+1
1470 ALLOCATE( zsea( ini ) )
1471 ALLOCATE( zwater( ini ) )
1472 ALLOCATE( znature( ini ) )
1473 ALLOCATE( ztown( ini ) )
1474 ALLOCATE( zt2m( ini ) )
1475 ALLOCATE( zq2m( ini ) )
1476 ALLOCATE( zz0( ini ) )
1477 ALLOCATE( zz0h( ini ) )
1478 ALLOCATE( zqs_sea( ini ) )
1479 ALLOCATE( zqs_water( ini ) )
1480 ALLOCATE( zqs_nature( ini ) )
1481 ALLOCATE( zqs_town( ini ) )
1482 ALLOCATE( zqs( ini ) )
1483 ALLOCATE( zpsng( ini ) )
1484 ALLOCATE( zpsnv( ini ) )
1485 ALLOCATE( zz0eff( ini ) )
1486 ALLOCATE( zzs( ini ) )
1489 CALL
get_surf_var_n(ysurf_cur%FM%DGF, ysurf_cur%IM%I, ysurf_cur%IM%DGI, ysurf_cur%IM%DGMI, &
1490 ysurf_cur%SM%DGS, ysurf_cur%DGU, ysurf_cur%TM%DGT, ysurf_cur%WM%DGW, &
1491 ysurf_cur%FM%F, ysurf_cur%UG, ysurf_cur%U, ysurf_cur%USS, &
1492 csurf_filetype,ini,iseries,psea=zsea,pwater=zwater,pnature=znature,ptown=ztown, &
1493 pt2m=zt2m,pq2m=zq2m,pqs=zqs,pz0=zz0,pz0h=zz0h,pz0eff=zz0eff,pqs_sea=zqs_sea, &
1494 pqs_water=zqs_water,pqs_nature=zqs_nature,pqs_town=zqs_town, &
1495 ppsng=zpsng,ppsnv=zpsnv,pzs=zzs )
1497 isize =
SIZE(nindex)
1498 IF (nrank==npio)
THEN
1500 ALLOCATE(zsea_full(isize))
1501 ALLOCATE(zwater_full(isize))
1502 ALLOCATE(znature_full(isize))
1503 ALLOCATE(ztown_full(isize))
1504 ALLOCATE(zz0_full(isize))
1505 ALLOCATE(zz0eff_full(isize))
1506 ALLOCATE(zzs_full(isize))
1510 ALLOCATE(zsea_full(0))
1511 ALLOCATE(zwater_full(0))
1512 ALLOCATE(znature_full(0))
1513 ALLOCATE(ztown_full(0))
1514 ALLOCATE(zz0_full(0))
1515 ALLOCATE(zz0eff_full(0))
1516 ALLOCATE(zzs_full(0))
1527 IF (nrank==npio)
THEN
1529 WRITE(iluout,
'(A32,I4,A3,I4)')
' GRID BOXES CONTAINING SEA : ',count( zsea_full(:) > 0. ),
' / ',isize
1530 WRITE(iluout,
'(A32,I4,A3,I4)')
' GRID BOXES CONTAINING WATER : ',count( zwater_full(:) > 0. ),
' / ',isize
1531 WRITE(iluout,
'(A32,I4,A3,I4)')
' GRID BOXES CONTAINING NATURE : ',count( znature_full(:) > 0. ),
' / ',isize
1532 WRITE(iluout,
'(A32,I4,A3,I4)')
' GRID BOXES CONTAINING TOWN : ',count( ztown_full(:) > 0. ),
' / ',isize
1533 WRITE(iluout,*)
'ZZ0 = ',zz0_full
1534 WRITE(iluout,*)
'ZZ0EFF = ',zz0eff_full
1535 WRITE(iluout,*)
'ZZS = ',zzs_full
1536 WRITE(iluout,*)
'MINVAL(ZZS) = ',minval(zzs_full),
' MAXVAL(ZZS) = ',maxval(zzs_full)
1541 DEALLOCATE( zwater )
1542 DEALLOCATE( znature )
1548 DEALLOCATE( zqs_sea )
1549 DEALLOCATE( zqs_water )
1550 DEALLOCATE( zqs_nature )
1551 DEALLOCATE( zqs_town )
1555 DEALLOCATE( zz0eff )
1558 IF (nrank==npio)
THEN
1560 DEALLOCATE(zsea_full )
1561 DEALLOCATE(zwater_full )
1562 DEALLOCATE(znature_full)
1563 DEALLOCATE(ztown_full )
1564 DEALLOCATE(zz0_full )
1565 DEALLOCATE(zz0eff_full )
1566 DEALLOCATE(zzs_full )
1577 #if ! defined in_arpege
1585 IF (nrank==npio)
THEN
1587 WRITE(iluout,*)
' --------------------------'
1588 WRITE(iluout,*)
' | OFFLINE ENDS CORRECTLY |'
1589 WRITE(iluout,*)
' --------------------------'
1595 WRITE(*,*)
' --------------------------'
1596 WRITE(*,*)
' | OFFLINE ENDS CORRECTLY |'
1597 WRITE(*,*)
' --------------------------'
1603 IF (
ALLOCATED(nindex))
DEALLOCATE(nindex)
1604 IF (
ALLOCATED(nsize_task))
DEALLOCATE(nsize_task)
1606 IF (
ASSOCIATED(nwork))
DEALLOCATE(nwork)
1607 IF (
ASSOCIATED(xwork))
DEALLOCATE(xwork)
1608 IF (
ASSOCIATED(nwork2))
DEALLOCATE(nwork2)
1609 IF (
ASSOCIATED(xwork2))
DEALLOCATE(xwork2)
1610 IF (
ASSOCIATED(xwork3))
DEALLOCATE(xwork3)
1611 IF (
ASSOCIATED(nwork_full))
DEALLOCATE(nwork_full)
1612 IF (
ASSOCIATED(xwork_full))
DEALLOCATE(xwork_full)
1613 IF (
ASSOCIATED(nwork2_full))
DEALLOCATE(nwork2_full)
1614 IF (
ASSOCIATED(xwork2_full))
DEALLOCATE(xwork2_full)
1618 IF (lhook) CALL dr_hook(
'OFFLINE',1,zhook_handle)
1626 CALL mpi_finalize(infompi)
subroutine slope_radiative_effect(PTSTEP, PZENITH, PAZIM, PPS, PTA, PRAIN, PDIR_SW, PLW, PZS, PZS_XY, PSLOPANG, PSLOPAZI, PSURF_TRIANGLE)
subroutine init_output_nc_n(BDD, CHE, CHN, CHU, DTS, DTT, DTZ, I, UG, U, DGU)
subroutine ol_read_atm(HSURF_FILETYPE, HFORCING_FILETYPE, KFORC_STEP, PTA, PQA, PWIND, PDIR_SW, PSCA_SW, PLW, PSNOW, PRAIN, PPS, PCO2, PDIR, OLIMIT_QAIR)
subroutine get_sizes_parallel(DTCO, DGU, UG, U, KPROC, KSIZE, KPROCMIN, KSIZE_TASK, OSHADOWS)
subroutine init_output_ol_n(YSC)
subroutine sfx_oasis_read_nam(HPROGRAM, PTSTEP_SURF, HINIT)
subroutine close_fileout_ol
subroutine write_budget_coupl_rout
subroutine get_surf_var_n(DGF, I, DGI, DGMI, DGS, DGU, DGT, DGW, F, UG, U, USS, HPROGRAM, KI, KS, PSEA, PWATER, PNATURE, PTOWN, PT2M, PQ2M, PQS, PZ0, PZ0H, PZ0EFF, PZ0_SEA, PZ0_WATER, PZ0_NATURE, PZ0_TOWN, PZ0H_SEA, PZ0H_WATER, PZ0H_NATURE, PZ0H_TOWN, PQS_SEA, PQS_WATER, PQS_NATURE, PQS_TOWN, PPSNG, PPSNV, PZS, PSERIES, PTWSNOW, PSSO_STDEV, PLON, PLAT, PBARE, PLAI_TREE, PH_TREE)
subroutine init_crodebug(I)
subroutine sfx_oasis_recv_ol(F, I, S, U, W, HPROGRAM, KI, KSW, PTIMEC, PTSTEP_SURF, KSIZE_OMP, PZENITH, PSW_BANDS, PTSRAD, PDIR_ALB, PSCA_ALB, PEMIS, PTSURF)
subroutine init_index_mpi(YSC, HPROGRAM, HALG, PIO_FRAC, OSHADOWS)
subroutine abor1_sfx(YTEXT)
subroutine close_filein_ol
subroutine flag_update(DGI, DGU, ONOWRITE_CANOPY, OPGD, OPROVAR_TO_DIAG, OSELECT)
subroutine write_diag_surf_atm_n(YSC, HPROGRAM, HWRITE)
subroutine init_surf_atm_n(YSC, HPROGRAM, HINIT, OLAND_USE, KI, KSV, KSW, HSV, PCO2, PRHOA, PZENITH, PAZIM, PSW_BANDS, PDIR_ALB, PSCA_ALB, PEMIS, PTSRAD, PTSURF, KYEAR, KMONTH, KDAY, PTIME, HATMFILE, HATMFILETYPE, HTEST)
subroutine prep_restart_coupl_topd(UG, U, HPROGRAM, KI)
subroutine sfx_oasis_send_ol(F, I, S, U, W, HPROGRAM, KI, PTIMEC, PSTEP_SURF, KSIZE_OMP)
subroutine open_close_bin_asc_forc(HACTION, HFORCING, HACTION2)
subroutine local_slope_param(JPINDX1, JPINDX2)
subroutine sfx_oasis_init(HNAMELIST, KLOCAL_COMM, HINIT)
subroutine surfex_deallo_list
subroutine close_namelist(HPROGRAM, KLUNAM)
subroutine goto_model(KMODEL)
subroutine coupling_surf_atm_n(YSC, HPROGRAM, HCOUPLING, PTIMEC, PTSTEP, KYEAR, KMONTH, KDAY, PTIME, KI, KSV, KSW, PTSUN, PZENITH, PZENITH2, PAZIM, PZREF, PUREF, PZS, PU, PV, PQA, PTA, PRHOA, PSV, PCO2, HSV, PRAIN, PSNOW, PLW, PDIR_SW, PSCA_SW, PSW_BANDS, PPS, PPA, PSFTQ, PSFTH, PSFTS, PSFCO2, PSFU, PSFV, PTRAD, PDIR_ALB, PSCA_ALB, PEMIS, PTSURF, PZ0, PZ0H, PQSURF, PPEW_A_COEF, PPEW_B_COEF, PPET_A_COEF, PPEQ_A_COEF, PPET_B_COEF, PPEQ_B_COEF, HTEST)
subroutine read_all_namelists(YSC, HPROGRAM, HINIT, ONAM_READ)
subroutine write_discharge_file(HPROGRAM, HFILE, HFORM, KYEAR, KMONTH, KDAY, KH, KM, PQTOT)
subroutine posnam(KULNAM, HDNAML, OFOUND, KLUOUT)
subroutine flag_diag_update(CHF, CHI, CHS, CHT, CHW, DGEI, DGF, DGI, DGMF, DGMI, DGMTO, DGO, DGS, DGSI, DGU, DGT, DGW, I, U, OFRAC, ODIAG_GRID, K2M, OSURF_BUDGET, ORAD_BUDGET, OCOEF, OSURF_VARS, KBEQ, KDSTEQ, ODIAG_OCEAN, ODIAG_SEAICE, OWATER_PROFILE, OSURF_EVAP_BUDGET, OFLOOD, OPGD_ISBA, OCH_NO_FLUX_ISBA, OSURF_MISC_BUDGET_ISBA, OPGD_TEB, OSURF_MISC_BUDGET_TEB)
subroutine get_luout(HPROGRAM, KLUOUT)
subroutine write_surf_atm_n(YSC, HPROGRAM, HWRITE, OLAND_USE)
subroutine sunpos(KSIZE_OMP, KYEAR, KMONTH, KDAY, PTIME, PLON, PLAT, PTSUN, PZENITH, PAZIMSOL)
subroutine wlog_mpi(HLOG, PLOG, KLOG, KLOG2, OLOG)
subroutine ol_read_atm_conf(YSC, HSURF_FILETYPE, HFORCING_FILETYPE, PDURATION, PTSTEP_FORC, KNI, KYEAR, KMONTH, KDAY, PTIME, PLAT, PLON, PZS, PZREF, PUREF)
subroutine surfex_alloc_list(KMODEL)
subroutine compare_orography(YSC, HPROGRAM, OSURFZS, PDELT_ZSMAX)
subroutine init_dim(KSIZE_OMP, KBLOCK, KKPROMA, KINDX1, KINDX2)
subroutine add_forecast_to_date_surf(KYEAR, KMONTH, KDAY, PSEC)
subroutine diag_surf_atm_n(DGEI, DGF, DGL, DGI, DGS, DGU, DGT, DGW, U, USS, HPROGRAM)
subroutine init_slope_param(UG, PZS, KI, PLAT)
subroutine sfx_oasis_def_ol(I, U, HPROGRAM, HALG_MPI)
subroutine open_namelist(HPROGRAM, KLUNAM, HFILE)
subroutine init_surf_landuse_n(YSC, HPROGRAM, HINIT, OLAND_USE, KI, KSV, KSW, HSV, PCO2, PRHOA, PZENITH, PAZIM, PSW_BANDS, PDIR_ALB, PSCA_ALB, PEMIS, PTSRAD, PTSURF, KYEAR, KMONTH, KDAY, PTIME, HATMFILE, HATMFILETYPE, HTEST)
subroutine reset_dim(KNI, KKPROMA, KINDX1, KINDX2)
subroutine ol_alloc_atm(KNI, KBANDS, KSCAL)
subroutine ol_time_interp_atm(KSURF_STEP, KNB_ATM, KSIZE_OMP, PTA1, PTA2, PQA1, PQA2, PWIND1, PWIND2, PDIR_SW1, PDIR_SW2, PSCA_SW1, PSCA_SW2, PLW1, PLW2, PSNOW2, PRAIN2, PPS1, PPS2, PCO21, PCO22, PDIR1, PDIR2)
subroutine open_filein_ol