11 use netcdf,
only: nf90_put_att,nf90_global
23 integer,
parameter ::
nlmax = 200
31 character(len=1024) :: datadir
32 character(len=1024) :: prefix
33 character(len=1024) :: model
35 logical :: default_seed
38 character(len=1024) :: method
39 character(len=1024) :: strategy
50 logical :: check_adjoints
51 logical :: check_pos_def
53 logical :: check_dirac
54 logical :: check_randomization
55 logical :: check_consistency
56 logical :: check_optimality
57 logical :: check_obsop
64 character(len=1024),
dimension(nvmax) :: varname
65 character(len=1024),
dimension(nvmax) :: addvar2d
67 integer,
dimension(ntsmax) :: timeslot
71 integer :: ens1_ne_offset
76 integer :: ens2_ne_offset
82 character(len=1024) :: mask_type
83 real(kind_real) :: mask_th
85 character(len=1024) :: draw_type
98 real(kind_real) :: vbal_rad
100 logical :: var_filter
102 real(kind_real) :: var_rhflt
104 logical :: local_diag
105 real(kind_real) :: local_rad
106 logical :: displ_diag
107 real(kind_real) :: displ_rad
108 integer :: displ_niter
109 real(kind_real) :: displ_rhflt
110 real(kind_real) :: displ_tol
113 character(len=1024) :: minim_algo
117 real(kind_real) :: rvflt
118 integer :: lct_nscales
123 real(kind_real) :: resol
124 logical :: fast_sampling
125 character(len=1024) :: nicas_interp
129 logical :: forced_radii
130 real(kind_real) :: rh
131 real(kind_real) :: rv
141 character(len=1024) :: obsdis
142 character(len=1024) :: obsop_interp
151 real(kind_real) :: diag_rhflt
152 character(len=1024) :: diag_interp
155 logical :: grid_output
156 real(kind_real) :: grid_resol
157 character(len=1024) :: grid_interp
182 class(nam_type),
intent(out) :: nam
191 nam%colorlog = .false.
192 nam%default_seed = .false.
197 nam%new_vbal = .false.
198 nam%load_vbal = .false.
199 nam%new_hdiag = .false.
200 nam%new_lct = .false.
201 nam%load_cmat = .false.
202 nam%new_nicas = .false.
203 nam%load_nicas = .false.
204 nam%new_obsop = .false.
205 nam%load_obsop = .false.
206 nam%check_vbal = .false.
207 nam%check_adjoints = .false.
208 nam%check_pos_def = .false.
209 nam%check_sqrt = .false.
210 nam%check_dirac = .false.
211 nam%check_randomization = .false.
212 nam%check_consistency = .false.
213 nam%check_optimality = .false.
214 nam%check_obsop = .false.
219 nam%logpres = .false.
223 nam%addvar2d(iv) =
'' 226 call msi(nam%timeslot)
229 call msi(nam%ens1_ne)
230 call msi(nam%ens1_ne_offset)
231 call msi(nam%ens1_nsub)
234 call msi(nam%ens2_ne)
235 call msi(nam%ens2_ne_offset)
236 call msi(nam%ens2_nsub)
239 nam%sam_write = .false.
240 nam%sam_read = .false.
242 call msr(nam%mask_th)
243 nam%mask_check = .false.
255 nam%gau_approx = .false.
257 nam%vbal_block(iv) = .false.
259 call msr(nam%vbal_rad)
260 nam%var_diag = .false.
261 nam%var_filter = .false.
262 nam%var_full = .false.
263 call msi(nam%var_niter)
264 call msr(nam%var_rhflt)
265 nam%local_diag = .false.
266 call msr(nam%local_rad)
267 nam%displ_diag = .false.
268 call msr(nam%displ_rad)
269 call msi(nam%displ_niter)
270 call msr(nam%displ_rhflt)
271 call msr(nam%displ_tol)
276 nam%double_fit(iv) = .false.
281 call msi(nam%lct_nscales)
282 nam%lct_diag = .false.
287 nam%fast_sampling = .false.
288 nam%nicas_interp =
'' 289 nam%network = .false.
291 call msi(nam%advmode)
292 nam%forced_radii = .false.
305 nam%obsop_interp =
'' 309 call msi(nam%il_ldwh)
310 call msi(nam%ic_ldwh)
312 call msr(nam%lon_ldwv)
313 call msr(nam%lat_ldwv)
314 call msr(nam%diag_rhflt)
316 nam%field_io = .true.
317 nam%split_io = .false.
318 nam%grid_output = .false.
319 call msr(nam%grid_resol)
328 subroutine nam_read(nam,mpl,namelname)
333 class(nam_type),
intent(inout) :: nam
334 type(mpl_type),
intent(in) :: mpl
335 character(len=*),
intent(in) :: namelname
342 integer :: nl,levs(nlmax),nv,nts,timeslot(ntsmax),ens1_ne,ens1_ne_offset,ens1_nsub,ens2_ne,ens2_ne_offset,ens2_nsub
343 integer :: nc1,nc2,ntry,nrep,nc3,nl0r,ne,var_niter,displ_niter,lct_nscales,mpicom,advmode,ndir,levdir(ndirmax),ivdir(ndirmax)
344 integer :: itsdir(ndirmax),nobs,nldwh,il_ldwh(nlmax*nc3max),ic_ldwh(nlmax*nc3max),nldwv
345 logical :: colorlog,default_seed
346 logical :: new_vbal,load_vbal,new_hdiag,new_lct,load_cmat,new_nicas,load_nicas,new_obsop,load_obsop
347 logical :: check_vbal,check_adjoints,check_pos_def,check_sqrt,check_dirac,check_randomization,check_consistency,check_optimality
348 logical :: check_obsop,logpres,sam_write,sam_read,mask_check
349 logical :: vbal_block(nvmax*(nvmax-1)/2),var_diag,var_filter,var_full,gau_approx,local_diag,displ_diag,double_fit(0:nvmax)
350 logical :: lhomh,lhomv,lct_diag(nscalesmax),lsqrt,fast_sampling,network,forced_radii,field_io,split_io,grid_output
351 real(kind_real) :: mask_th,dc,vbal_rad,var_rhflt,local_rad,displ_rad,displ_rhflt,displ_tol,rvflt,lon_ldwv(nldwvmax)
352 real(kind_real) :: lat_ldwv(nldwvmax),diag_rhflt,resol,rh,rv,londir(ndirmax),latdir(ndirmax),grid_resol
353 character(len=1024) :: datadir,prefix,model,strategy,method,mask_type,draw_type,minim_algo,nicas_interp
354 character(len=1024) :: obsdis,obsop_interp,diag_interp,grid_interp
355 character(len=1024),
dimension(nvmax) :: varname,addvar2d
358 namelist/general_param/datadir,prefix,model,colorlog,default_seed
359 namelist/driver_param/method,strategy,new_vbal,load_vbal,new_hdiag,new_lct,load_cmat,new_nicas,load_nicas,new_obsop,load_obsop, &
360 & check_vbal,check_adjoints,check_pos_def,check_sqrt,check_dirac,check_randomization,check_consistency, &
361 & check_optimality,check_obsop
362 namelist/model_param/nl,levs,logpres,nv,varname,addvar2d,nts,timeslot
363 namelist/ens1_param/ens1_ne,ens1_ne_offset,ens1_nsub
364 namelist/ens2_param/ens2_ne,ens2_ne_offset,ens2_nsub
365 namelist/sampling_param/sam_write,sam_read,mask_type,mask_th,mask_check,draw_type,nc1,nc2,ntry,nrep,nc3,dc,nl0r
366 namelist/diag_param/ne,gau_approx,vbal_block,vbal_rad,var_diag,var_filter,var_full,var_niter,var_rhflt,local_diag,local_rad, &
367 & displ_diag,displ_rad,displ_niter,displ_rhflt,displ_tol
368 namelist/fit_param/minim_algo,double_fit,lhomh,lhomv,rvflt,lct_nscales,lct_diag
369 namelist/nicas_param/lsqrt,resol,fast_sampling,nicas_interp,network,mpicom,advmode,forced_radii,rh,rv,ndir,londir,latdir,levdir, &
371 namelist/obsop_param/nobs,obsdis,obsop_interp
372 namelist/output_param/nldwh,il_ldwh,ic_ldwh,nldwv,lon_ldwv,lat_ldwv,diag_rhflt,diag_interp,field_io,split_io, &
373 & grid_output,grid_resol,grid_interp
381 default_seed = .false.
396 check_adjoints = .false.
397 check_pos_def = .false.
399 check_dirac = .false.
400 check_randomization = .false.
401 check_consistency = .false.
402 check_optimality = .false.
403 check_obsop = .false.
419 call msi(ens1_ne_offset)
424 call msi(ens2_ne_offset)
445 do iv=1,nvmax*(nvmax-1)/2
446 vbal_block(iv) = .false.
458 call msi(displ_niter)
459 call msr(displ_rhflt)
465 double_fit(iv) = .false.
470 call msi(lct_nscales)
480 forced_radii = .false.
506 grid_output = .false.
511 call mpl%newunit(lunit)
512 open(unit=lunit,file=trim(namelname),status=
'old',action=
'read')
515 read(lunit,nml=general_param)
516 nam%datadir = datadir
519 nam%colorlog = colorlog
520 nam%default_seed = default_seed
523 read(lunit,nml=driver_param)
525 nam%strategy = strategy
526 nam%new_vbal = new_vbal
527 nam%load_vbal = load_vbal
528 nam%new_hdiag = new_hdiag
529 nam%new_lct = new_lct
530 nam%load_cmat = load_cmat
531 nam%new_nicas = new_nicas
532 nam%load_nicas = load_nicas
533 nam%new_obsop = new_obsop
534 nam%load_obsop = load_obsop
535 nam%check_vbal = check_vbal
536 nam%check_adjoints = check_adjoints
537 nam%check_pos_def = check_pos_def
538 nam%check_sqrt = check_sqrt
539 nam%check_dirac = check_dirac
540 nam%check_randomization = check_randomization
541 nam%check_consistency = check_consistency
542 nam%check_optimality = check_optimality
543 nam%check_obsop = check_obsop
546 read(lunit,nml=model_param)
547 if (nl>nlmax)
call mpl%abort(
'nl is too large')
548 if (nv>nvmax)
call mpl%abort(
'nv is too large')
549 if (nts>ntsmax)
call mpl%abort(
'nts is too large')
551 if (nl>0) nam%levs(1:nl) = levs(1:nl)
552 nam%logpres = logpres
554 if (nv>0) nam%varname(1:nv) = varname(1:nv)
555 if (nv>0) nam%addvar2d(1:nv) = addvar2d(1:nv)
557 if (nts>0) nam%timeslot(1:nts) = timeslot(1:nts)
560 read(lunit,nml=ens1_param)
561 nam%ens1_ne = ens1_ne
562 nam%ens1_ne_offset = ens1_ne_offset
563 nam%ens1_nsub = ens1_nsub
566 read(lunit,nml=ens2_param)
567 nam%ens2_ne = ens2_ne
568 nam%ens2_ne_offset = ens2_ne_offset
569 nam%ens2_nsub = ens2_nsub
572 read(lunit,nml=sampling_param)
573 if (nc3>nc3max)
call mpl%abort(
'nc3 is too large')
574 nam%sam_write = sam_write
575 nam%sam_read = sam_read
576 nam%mask_type = mask_type
577 nam%mask_th = mask_th
578 nam%mask_check = mask_check
579 nam%draw_type = draw_type
589 read(lunit,nml=diag_param)
591 nam%gau_approx = gau_approx
592 if (nv>1) nam%vbal_block(1:nam%nv*(nam%nv-1)/2) = vbal_block(1:nam%nv*(nam%nv-1)/2)
593 nam%vbal_rad = vbal_rad
594 nam%var_diag = var_diag
595 nam%var_filter = var_filter
596 nam%var_full = var_full
597 nam%var_niter = var_niter
598 nam%var_rhflt = var_rhflt
599 nam%local_diag = local_diag
600 nam%local_rad = local_rad
601 nam%displ_diag = displ_diag
602 nam%displ_rad = displ_rad
603 nam%displ_niter = displ_niter
604 nam%displ_rhflt = displ_rhflt
605 nam%displ_tol = displ_tol
608 read(lunit,nml=fit_param)
609 if (lct_nscales>nscalesmax)
call mpl%abort(
'lct_nscales is too large')
610 nam%minim_algo = minim_algo
611 if (nv>0) nam%double_fit(1:nv) = double_fit(1:nv)
615 nam%lct_nscales = lct_nscales
616 if (lct_nscales>0) nam%lct_diag(1:lct_nscales) = lct_diag(1:lct_nscales)
619 read(lunit,nml=nicas_param)
620 if (ndir>ndirmax)
call mpl%abort(
'ndir is too large')
623 nam%fast_sampling = fast_sampling
624 nam%nicas_interp = nicas_interp
625 nam%network = network
627 nam%advmode = advmode
628 nam%forced_radii = forced_radii
632 if (ndir>0) nam%londir(1:ndir) = londir(1:ndir)
633 if (ndir>0) nam%latdir(1:ndir) = latdir(1:ndir)
634 if (ndir>0) nam%levdir(1:ndir) = levdir(1:ndir)
635 if (ndir>0) nam%ivdir(1:ndir) = ivdir(1:ndir)
636 if (ndir>0) nam%itsdir(1:ndir) = itsdir(1:ndir)
639 read(lunit,nml=obsop_param)
642 nam%obsop_interp = obsop_interp
645 read(lunit,nml=output_param)
646 if (nldwh>nlmax*nc3max)
call mpl%abort(
'nldwh is too large')
647 if (nldwv>nldwvmax)
call mpl%abort(
'nldwv is too large')
649 if (nldwh>0) nam%il_ldwh(1:nldwh) = il_ldwh(1:nldwh)
650 if (nldwh>0) nam%ic_ldwh(1:nldwh) = ic_ldwh(1:nldwh)
652 if (nldwv>0) nam%lon_ldwv(1:nldwv) = lon_ldwv(1:nldwv)
653 if (nldwv>0) nam%lat_ldwv(1:nldwv) = lat_ldwv(1:nldwv)
654 nam%diag_rhflt = diag_rhflt
655 nam%diag_interp = diag_interp
656 nam%field_io = field_io
657 nam%split_io = split_io
658 nam%grid_output = grid_output
659 nam%grid_resol = grid_resol
660 nam%grid_interp = grid_interp
677 class(nam_type),
intent(inout) :: nam
678 type(mpl_type),
intent(in) :: mpl
681 call mpl%f_comm%broadcast(nam%datadir,mpl%ioproc-1)
682 call mpl%f_comm%broadcast(nam%prefix,mpl%ioproc-1)
683 call mpl%f_comm%broadcast(nam%model,mpl%ioproc-1)
684 call mpl%f_comm%broadcast(nam%colorlog,mpl%ioproc-1)
685 call mpl%f_comm%broadcast(nam%default_seed,mpl%ioproc-1)
688 call mpl%f_comm%broadcast(nam%method,mpl%ioproc-1)
689 call mpl%f_comm%broadcast(nam%strategy,mpl%ioproc-1)
690 call mpl%f_comm%broadcast(nam%new_vbal,mpl%ioproc-1)
691 call mpl%f_comm%broadcast(nam%load_vbal,mpl%ioproc-1)
692 call mpl%f_comm%broadcast(nam%new_hdiag,mpl%ioproc-1)
693 call mpl%f_comm%broadcast(nam%new_lct,mpl%ioproc-1)
694 call mpl%f_comm%broadcast(nam%load_cmat,mpl%ioproc-1)
695 call mpl%f_comm%broadcast(nam%new_nicas,mpl%ioproc-1)
696 call mpl%f_comm%broadcast(nam%load_nicas,mpl%ioproc-1)
697 call mpl%f_comm%broadcast(nam%new_obsop,mpl%ioproc-1)
698 call mpl%f_comm%broadcast(nam%load_obsop,mpl%ioproc-1)
699 call mpl%f_comm%broadcast(nam%check_vbal,mpl%ioproc-1)
700 call mpl%f_comm%broadcast(nam%check_adjoints,mpl%ioproc-1)
701 call mpl%f_comm%broadcast(nam%check_pos_def,mpl%ioproc-1)
702 call mpl%f_comm%broadcast(nam%check_sqrt,mpl%ioproc-1)
703 call mpl%f_comm%broadcast(nam%check_dirac,mpl%ioproc-1)
704 call mpl%f_comm%broadcast(nam%check_randomization,mpl%ioproc-1)
705 call mpl%f_comm%broadcast(nam%check_consistency,mpl%ioproc-1)
706 call mpl%f_comm%broadcast(nam%check_optimality,mpl%ioproc-1)
707 call mpl%f_comm%broadcast(nam%check_obsop,mpl%ioproc-1)
710 call mpl%f_comm%broadcast(nam%nl,mpl%ioproc-1)
711 call mpl%f_comm%broadcast(nam%levs,mpl%ioproc-1)
712 call mpl%f_comm%broadcast(nam%logpres,mpl%ioproc-1)
713 call mpl%f_comm%broadcast(nam%nv,mpl%ioproc-1)
714 call mpl%bcast(nam%varname,mpl%ioproc-1)
715 call mpl%bcast(nam%addvar2d,mpl%ioproc-1)
716 call mpl%f_comm%broadcast(nam%nts,mpl%ioproc-1)
717 call mpl%f_comm%broadcast(nam%timeslot,mpl%ioproc-1)
720 call mpl%f_comm%broadcast(nam%ens1_ne,mpl%ioproc-1)
721 call mpl%f_comm%broadcast(nam%ens1_ne_offset,mpl%ioproc-1)
722 call mpl%f_comm%broadcast(nam%ens1_nsub,mpl%ioproc-1)
725 call mpl%f_comm%broadcast(nam%ens2_ne,mpl%ioproc-1)
726 call mpl%f_comm%broadcast(nam%ens2_ne_offset,mpl%ioproc-1)
727 call mpl%f_comm%broadcast(nam%ens2_nsub,mpl%ioproc-1)
730 call mpl%f_comm%broadcast(nam%sam_write,mpl%ioproc-1)
731 call mpl%f_comm%broadcast(nam%sam_read,mpl%ioproc-1)
732 call mpl%f_comm%broadcast(nam%mask_type,mpl%ioproc-1)
733 call mpl%f_comm%broadcast(nam%mask_th,mpl%ioproc-1)
734 call mpl%f_comm%broadcast(nam%mask_check,mpl%ioproc-1)
735 call mpl%f_comm%broadcast(nam%draw_type,mpl%ioproc-1)
736 call mpl%f_comm%broadcast(nam%nc1,mpl%ioproc-1)
737 call mpl%f_comm%broadcast(nam%nc2,mpl%ioproc-1)
738 call mpl%f_comm%broadcast(nam%ntry,mpl%ioproc-1)
739 call mpl%f_comm%broadcast(nam%nrep,mpl%ioproc-1)
740 call mpl%f_comm%broadcast(nam%nc3,mpl%ioproc-1)
741 call mpl%f_comm%broadcast(nam%dc,mpl%ioproc-1)
742 call mpl%f_comm%broadcast(nam%nl0r,mpl%ioproc-1)
745 call mpl%f_comm%broadcast(nam%ne,mpl%ioproc-1)
746 call mpl%f_comm%broadcast(nam%gau_approx,mpl%ioproc-1)
747 call mpl%f_comm%broadcast(nam%vbal_block,mpl%ioproc-1)
748 call mpl%f_comm%broadcast(nam%vbal_rad,mpl%ioproc-1)
749 call mpl%f_comm%broadcast(nam%var_diag,mpl%ioproc-1)
750 call mpl%f_comm%broadcast(nam%var_filter,mpl%ioproc-1)
751 call mpl%f_comm%broadcast(nam%var_full,mpl%ioproc-1)
752 call mpl%f_comm%broadcast(nam%var_niter,mpl%ioproc-1)
753 call mpl%f_comm%broadcast(nam%var_rhflt,mpl%ioproc-1)
754 call mpl%f_comm%broadcast(nam%local_diag,mpl%ioproc-1)
755 call mpl%f_comm%broadcast(nam%local_rad,mpl%ioproc-1)
756 call mpl%f_comm%broadcast(nam%displ_diag,mpl%ioproc-1)
757 call mpl%f_comm%broadcast(nam%displ_rad,mpl%ioproc-1)
758 call mpl%f_comm%broadcast(nam%displ_niter,mpl%ioproc-1)
759 call mpl%f_comm%broadcast(nam%displ_rhflt,mpl%ioproc-1)
760 call mpl%f_comm%broadcast(nam%displ_tol,mpl%ioproc-1)
763 call mpl%f_comm%broadcast(nam%minim_algo,mpl%ioproc-1)
764 call mpl%f_comm%broadcast(nam%double_fit,mpl%ioproc-1)
765 call mpl%f_comm%broadcast(nam%lhomh,mpl%ioproc-1)
766 call mpl%f_comm%broadcast(nam%lhomv,mpl%ioproc-1)
767 call mpl%f_comm%broadcast(nam%rvflt,mpl%ioproc-1)
768 call mpl%f_comm%broadcast(nam%lct_nscales,mpl%ioproc-1)
769 call mpl%f_comm%broadcast(nam%lct_diag,mpl%ioproc-1)
772 call mpl%f_comm%broadcast(nam%lsqrt,mpl%ioproc-1)
773 call mpl%f_comm%broadcast(nam%resol,mpl%ioproc-1)
774 call mpl%f_comm%broadcast(nam%fast_sampling,mpl%ioproc-1)
775 call mpl%f_comm%broadcast(nam%nicas_interp,mpl%ioproc-1)
776 call mpl%f_comm%broadcast(nam%network,mpl%ioproc-1)
777 call mpl%f_comm%broadcast(nam%mpicom,mpl%ioproc-1)
778 call mpl%f_comm%broadcast(nam%advmode,mpl%ioproc-1)
779 call mpl%f_comm%broadcast(nam%forced_radii,mpl%ioproc-1)
780 call mpl%f_comm%broadcast(nam%rh,mpl%ioproc-1)
781 call mpl%f_comm%broadcast(nam%rv,mpl%ioproc-1)
782 call mpl%f_comm%broadcast(nam%ndir,mpl%ioproc-1)
783 call mpl%f_comm%broadcast(nam%londir,mpl%ioproc-1)
784 call mpl%f_comm%broadcast(nam%latdir,mpl%ioproc-1)
785 call mpl%f_comm%broadcast(nam%levdir,mpl%ioproc-1)
786 call mpl%f_comm%broadcast(nam%ivdir,mpl%ioproc-1)
787 call mpl%f_comm%broadcast(nam%itsdir,mpl%ioproc-1)
790 call mpl%f_comm%broadcast(nam%nobs,mpl%ioproc-1)
791 call mpl%f_comm%broadcast(nam%obsdis,mpl%ioproc-1)
792 call mpl%f_comm%broadcast(nam%obsop_interp,mpl%ioproc-1)
795 call mpl%f_comm%broadcast(nam%nldwh,mpl%ioproc-1)
796 call mpl%f_comm%broadcast(nam%il_ldwh,mpl%ioproc-1)
797 call mpl%f_comm%broadcast(nam%ic_ldwh,mpl%ioproc-1)
798 call mpl%f_comm%broadcast(nam%nldwv,mpl%ioproc-1)
799 call mpl%f_comm%broadcast(nam%lon_ldwv,mpl%ioproc-1)
800 call mpl%f_comm%broadcast(nam%lat_ldwv,mpl%ioproc-1)
801 call mpl%f_comm%broadcast(nam%diag_rhflt,mpl%ioproc-1)
802 call mpl%f_comm%broadcast(nam%diag_interp,mpl%ioproc-1)
803 call mpl%f_comm%broadcast(nam%field_io,mpl%ioproc-1)
804 call mpl%f_comm%broadcast(nam%split_io,mpl%ioproc-1)
805 call mpl%f_comm%broadcast(nam%grid_output,mpl%ioproc-1)
806 call mpl%f_comm%broadcast(nam%grid_resol,mpl%ioproc-1)
807 call mpl%f_comm%broadcast(nam%grid_interp,mpl%ioproc-1)
820 class(nam_type),
intent(inout) :: nam
821 integer,
intent(in) :: nl0
822 integer,
intent(in) :: nv
823 integer,
intent(in) :: nts
824 integer,
intent(in) :: ens1_ne
825 integer,
intent(in) :: ens1_nsub
826 integer,
intent(in) :: ens2_ne
827 integer,
intent(in) :: ens2_nsub
832 if (trim(nam%datadir)==
'') nam%datadir =
'.' 834 nam%colorlog = .false.
839 nam%logpres = .false.
842 write(nam%varname(iv),
'(a,i2.2)')
'var_',iv
843 nam%addvar2d(iv) =
'' 847 nam%ens1_ne = ens1_ne
848 nam%ens1_ne_offset = 0
849 nam%ens1_nsub = ens1_nsub
850 nam%ens2_ne = ens2_ne
851 nam%ens2_ne_offset = 0
852 nam%ens2_nsub = ens2_nsub
865 class(nam_type),
intent(inout) :: nam
866 type(mpl_type),
intent(in) :: mpl
869 integer :: iv,its,il,idir
870 character(len=2) :: ivchar
873 if (nam%nl>
nlmax)
call mpl%abort(
'nl is too large')
874 if (nam%nv>
nvmax)
call mpl%abort(
'nv is too large')
875 if (nam%nts>
ntsmax)
call mpl%abort(
'nts is too large')
876 if (nam%nc3>
nc3max)
call mpl%abort(
'nc3 is too large')
877 if (nam%lct_nscales>
nscalesmax)
call mpl%abort(
'lct_nscales is too large')
878 if (nam%ndir>
ndirmax)
call mpl%abort(
'ndir is too large')
879 if (nam%nldwh>
nlmax*
nc3max)
call mpl%abort(
'nldwh is too large')
880 if (nam%nldwv>
nldwvmax)
call mpl%abort(
'nldwv is too large')
884 nam%vbal_rad = nam%vbal_rad/
req 885 nam%var_rhflt = nam%var_rhflt/
req 886 nam%local_rad = nam%local_rad/
req 887 nam%displ_rad = nam%displ_rad/
req 888 nam%displ_rhflt = nam%displ_rhflt/
req 890 if (nam%ndir>0) nam%londir(1:nam%ndir) = nam%londir(1:nam%ndir)*
deg2rad 891 if (nam%ndir>0) nam%latdir(1:nam%ndir) = nam%latdir(1:nam%ndir)*
deg2rad 892 if (nam%nldwv>0) nam%lon_ldwv(1:nam%nldwv) = nam%lon_ldwv(1:nam%nldwv)*
deg2rad 893 if (nam%nldwv>0) nam%lat_ldwv(1:nam%nldwv) = nam%lat_ldwv(1:nam%nldwv)*
deg2rad 894 nam%diag_rhflt = nam%diag_rhflt/
req 895 nam%grid_resol = nam%grid_resol/
req 898 if (trim(nam%datadir)==
'')
call mpl%abort(
'datadir not specified')
899 if (trim(nam%prefix)==
'')
call mpl%abort(
'prefix not specified')
900 select case (trim(nam%model))
901 case (
'aro',
'arp',
'fv3',
'gem',
'geos',
'gfs',
'ifs',
'mpas',
'nemo',
'online',
'wrf')
903 call mpl%abort(
'wrong model')
907 if (nam%new_hdiag.or.nam%check_consistency.or.nam%check_optimality)
then 908 select case (trim(nam%method))
909 case (
'cor',
'loc_norm',
'loc',
'hyb-avg',
'hyb-rnd',
'dual-ens')
911 call mpl%abort(
'wrong method')
914 if (nam%new_lct)
then 915 if (trim(nam%method)/=
'cor')
call mpl%abort(
'new_lct requires cor method')
917 if (nam%new_hdiag.or.nam%new_lct.or.nam%load_cmat.or.nam%new_nicas.or.nam%load_nicas)
then 918 select case (trim(nam%strategy))
919 case (
'diag_all',
'common',
'common_univariate',
'common_weighted',
'specific_univariate')
920 case (
'specific_multivariate')
921 if (.not.nam%lsqrt)
call mpl%abort(
'specific multivariate strategy requires a square-root formulation')
923 call mpl%abort(
'wrong strategy')
926 if (nam%new_vbal.and.nam%load_vbal)
call mpl%abort(
'new_vbal and load_vbal are exclusive')
927 if (nam%new_hdiag.and.nam%new_lct)
call mpl%abort(
'new_hdiag and new_lct are exclusive')
928 if ((nam%new_hdiag.or.nam%new_lct).and.nam%load_cmat)
call mpl%abort(
'new_hdiag or new_lct and load_cmat are exclusive')
929 if (nam%new_nicas.and.nam%load_nicas)
call mpl%abort(
'new_nicas and load_nicas are exclusive')
930 if (nam%new_obsop.and.nam%load_obsop)
call mpl%abort(
'new_obsop and load_obsop are exclusive')
931 if (nam%check_vbal.and..not.(nam%new_vbal.or.nam%load_vbal))
call mpl%abort(
'check_vbal requires new_vbal or load_vbal')
932 if (nam%new_nicas.and..not.(nam%new_hdiag.or.nam%new_lct.or.nam%load_cmat.or.nam%forced_radii)) &
933 &
call mpl%abort(
'new_nicas requires a C matrix')
934 if (nam%check_adjoints.and..not.(nam%new_nicas.or.nam%load_nicas))
call mpl%abort(
'check_adjoint requires new_nicas or load_nicas')
935 if (nam%check_pos_def.and..not.(nam%new_nicas.or.nam%load_nicas))
call mpl%abort(
'check_pos_def requires new_nicas or load_nicas')
936 if (nam%check_sqrt.and..not.(nam%new_nicas.or.nam%load_nicas))
call mpl%abort(
'check_sqrt requires new_nicas or load_nicas')
937 if (nam%check_dirac.and..not.(nam%new_nicas.or.nam%load_nicas))
call mpl%abort(
'check_dirac requires new_nicas or load_nicas')
938 if (nam%check_randomization.and..not.(nam%new_nicas.or.nam%load_nicas)) &
939 &
call mpl%abort(
'check_randomization requires new_nicas or load_nicas')
940 if (nam%check_consistency.and..not.((nam%new_hdiag.or.nam%load_cmat).and.nam%new_nicas)) &
941 &
call mpl%abort(
'check_adjoint requires new_nicas or load_nicas and new_nicas')
942 if (nam%check_optimality.and..not.(nam%new_nicas.or.nam%load_nicas)) &
943 &
call mpl%abort(
'check_optimality requires new_nicas or load_nicas')
944 if (nam%check_obsop.and..not.(nam%new_obsop.or.nam%load_obsop))
call mpl%abort(
'check_obsop requires new_obsop or load_obsop')
947 if (nam%nl<=0)
call mpl%abort(
'nl should be positive')
949 if (nam%levs(il)<=0)
call mpl%abort(
'levs should be positive')
950 if (count(nam%levs(1:nam%nl)==nam%levs(il))>1)
call mpl%abort(
'redundant levels')
952 if (nam%logpres)
then 953 select case (trim(nam%model))
955 call mpl%warning(
'pressure logarithm vertical coordinate is not available for this model, resetting to model level index')
956 nam%logpres = .false.
959 if (nam%new_vbal.or.nam%load_vbal.or.nam%new_hdiag.or.nam%new_lct.or.nam%load_cmat.or.nam%new_nicas.or.nam%load_nicas)
then 960 if (nam%nv<=0)
call mpl%abort(
'nv should be positive')
962 write(ivchar,
'(i2.2)') iv
963 if (trim(nam%varname(iv))==
'')
call mpl%abort(
'varname not specified for variable '//ivchar)
965 if (nam%nts<=0)
call mpl%abort(
'nts should be positive')
967 if (nam%timeslot(its)<0)
call mpl%abort(
'timeslot should be non-negative')
970 if (trim(nam%addvar2d(iv))/=
'') nam%levs(nam%nl+1) = maxval(nam%levs(1:nam%nl))+1
975 if (nam%new_vbal.or.nam%new_hdiag.or.nam%new_lct)
then 976 if (nam%ens1_ne_offset<0)
call mpl%abort(
'ens1_ne_offset should be non-negative')
977 if (nam%ens1_nsub<1)
call mpl%abort(
'ens1_nsub should be positive')
978 if (mod(nam%ens1_ne,nam%ens1_nsub)/=0)
call mpl%abort(
'ens1_nsub should be a divider of ens1_ne')
979 if (nam%ens1_ne/nam%ens1_nsub<=3)
call mpl%abort(
'ens1_ne/ens1_nsub should be larger than 3')
983 if (nam%new_hdiag)
then 984 select case (trim(nam%method))
985 case (
'hyb-rnd',
'dual-ens')
986 if (nam%ens2_ne_offset<0)
call mpl%abort(
'ens2_ne_offset should be non-negative')
987 if (nam%ens2_nsub<1)
call mpl%abort(
'ens2_nsub should be non-negative')
988 if (mod(nam%ens2_ne,nam%ens2_nsub)/=0)
call mpl%abort(
'ens2_nsub should be a divider of ens2_ne')
989 if (nam%ens2_ne/nam%ens2_nsub<=3)
call mpl%abort(
'ens2_ne/ens2_nsub should be larger than 3')
994 if (nam%new_vbal.or.nam%new_hdiag.or.nam%new_lct)
then 995 if (nam%sam_write.and.nam%sam_read)
call mpl%abort(
'sam_write and sam_read are both true')
996 select case (trim(nam%draw_type))
997 case (
'random_uniform',
'random_coast',
'icosahedron')
999 call mpl%abort(
'wrong draw_type')
1001 if (nam%nc1<3)
call mpl%abort(
'nc1 should be larger than 2')
1002 if (nam%new_vbal.or.(nam%new_hdiag.and.(nam%var_diag.or.nam%local_diag.or.nam%displ_diag)))
then 1003 if (nam%nc2<3)
call mpl%abort(
'nc2 should be larger than 2')
1006 call mpl%warning(
'nc2 should be set non-negative, resetting nc2 to zero')
1010 if (nam%new_lct)
then 1011 if (nam%nc2/=nam%nc1)
then 1012 call mpl%warning(
'nc2 should be equal to nc2 for new_lct, resetting nc2 to nc1')
1017 if (nam%new_vbal.or.nam%new_hdiag.or.nam%new_lct.or.nam%new_nicas)
then 1018 if (nam%ntry<=0)
call mpl%abort(
'ntry should be positive')
1019 if (nam%nrep<0)
call mpl%abort(
'nrep should be non-negative')
1021 if (nam%new_hdiag.or.nam%new_lct)
then 1022 if (nam%nc3<=0)
call mpl%abort(
'nc3 should be positive')
1026 if (nam%new_vbal.or.nam%load_vbal.or.nam%new_hdiag.or.nam%new_lct)
then 1027 if (nam%nl0r<1)
call mpl%abort (
'nl0r should be positive')
1029 if (nam%new_hdiag)
then 1030 if (nam%dc<0.0)
call mpl%abort(
'dc should be positive')
1034 if (nam%new_vbal)
then 1035 if (nam%nv<2)
call mpl%abort(
'at least two variables required to diagnose vertical balance')
1036 if (.not.(any(nam%vbal_block(1:nam%nv*(nam%nv-1)/2)))) &
1037 &
call mpl%abort(
'no block selected for the vertical balance diagnostics')
1039 if (nam%vbal_rad<0.0)
call mpl%abort(
'vbal_rad should be non-negative')
1041 if (nam%new_hdiag)
then 1042 select case (trim(nam%method))
1043 case (
'loc_norm',
'loc',
'hyb-avg',
'hyb-rnd',
'dual-ens')
1044 if (nam%ne<=3)
call mpl%abort(
'ne should be larger than 3')
1046 if (nam%var_diag.and.(.not.trim(nam%method)==
'cor'))
call mpl%abort(
'var_diag requires method = cor')
1047 if (nam%var_filter.and.(.not.nam%var_diag))
call mpl%abort(
'var_filter requires var_diag')
1048 if (nam%var_filter)
then 1049 if (nam%var_niter<=0)
call mpl%abort(
'var_niter should be positive')
1050 if (nam%var_rhflt<0.0)
call mpl%abort(
'var_rhflt should be non-negative')
1052 if (nam%local_diag)
then 1053 if (nam%local_rad<0.0)
call mpl%abort(
'displ_rad should be non-negative')
1055 if (nam%displ_diag)
then 1056 if (nam%displ_rad<0.0)
call mpl%abort(
'local_rad should be non-negative')
1057 if (nam%displ_niter<=0)
call mpl%abort(
'displ_niter should be positive')
1058 if (nam%displ_rhflt<0.0)
call mpl%abort(
'displ_rhflt should be non-negative')
1059 if (nam%displ_tol<0.0)
call mpl%abort(
'displ_tol should be non-negative')
1064 if (nam%new_hdiag.or.nam%new_lct)
then 1065 select case (trim(nam%minim_algo))
1066 case (
'none',
'fast',
'hooke')
1068 call mpl%abort(
'wrong minim_algo')
1070 if (nam%new_lct.and.((trim(nam%minim_algo)==
'none').or.(trim(nam%minim_algo)==
'fast'))) &
1071 &
call mpl%abort(
'wrong minim_algo for LCT')
1072 if (nam%rvflt<0)
call mpl%abort(
'rvflt should be non-negative')
1074 if (nam%new_lct)
then 1075 if (nam%lct_nscales<=0)
call mpl%abort(
'lct_nscales should be postive')
1079 if (nam%new_hdiag)
then 1080 if (trim(nam%method)/=
'cor')
then 1081 if (nam%ne>nam%ens1_ne)
call mpl%warning(
'ensemble size larger than ens1_ne (might enhance sampling noise)')
1082 select case (trim(nam%method))
1083 case (
'hyb-avg',
'hyb-rnd',
'dual-ens')
1084 if (nam%ne>nam%ens2_ne)
call mpl%warning(
'ensemble size larger than ens2_ne (might enhance sampling noise)')
1090 if (nam%new_nicas.or.nam%check_adjoints.or.nam%check_pos_def.or.nam%check_sqrt.or.nam%check_dirac.or.nam%check_randomization &
1091 & .or.nam%check_consistency.or.nam%check_optimality)
then 1093 if (nam%mpicom==1)
call mpl%abort(
'mpicom should be 2 for square-root application')
1095 if (nam%check_randomization)
then 1096 if (.not.nam%lsqrt)
call mpl%abort(
'lsqrt required for check_randomization')
1098 if (nam%check_consistency)
then 1099 if (.not.nam%lsqrt)
call mpl%abort(
'lsqrt required for check_consistency')
1101 if (nam%check_optimality)
then 1102 if (.not.nam%lsqrt)
call mpl%abort(
'lsqrt required for check_optimality')
1104 if (nam%new_nicas)
then 1105 if (.not.(nam%resol>0.0))
call mpl%abort(
'resol should be positive')
1107 if (nam%new_nicas.or.nam%load_nicas)
then 1108 if ((nam%mpicom/=1).and.(nam%mpicom/=2))
call mpl%abort(
'mpicom should be 1 or 2')
1110 if (nam%forced_radii)
then 1111 if (nam%new_hdiag.or.nam%new_lct.or.nam%load_cmat) &
1112 &
call mpl%abort(
'forced_radii requires new_hdiag, new_lct and load_cmat to be inactive')
1113 if (nam%rh<0.0)
call mpl%abort(
'rh should be non-negative')
1114 if (nam%rv<0.0)
call mpl%abort(
'rv should be non-negative')
1116 if (abs(nam%advmode)>1)
call mpl%abort(
'nam%advmode should be -1, 0 or 1')
1117 if (nam%check_dirac)
then 1118 if (nam%ndir<1)
call mpl%abort(
'ndir should be positive')
1120 if ((nam%londir(idir)<-180.0).or.(nam%londir(idir)>180.0)) &
1121 &
call mpl%abort(
'Dirac longitude should lie between -180 and 180')
1122 if ((nam%latdir(idir)<-90.0).or.(nam%latdir(idir)>90.0))
call mpl%abort(
'Dirac latitude should lie between -90 and 90')
1123 if (.not.(any(nam%levs(1:nam%nl)==nam%levdir(idir)).or.(any(nam%addvar2d(1:nam%nv)/=
'') &
1124 & .and.(nam%levs(nam%nl+1)==nam%levdir(idir)))))
call mpl%abort(
'wrong level for a Dirac')
1125 if ((nam%ivdir(idir)<1).or.(nam%ivdir(idir)>nam%nv))
call mpl%abort(
'wrong variable for a Dirac')
1126 if ((nam%itsdir(idir)<1).or.(nam%itsdir(idir)>nam%nts))
call mpl%abort(
'wrong timeslot for a Dirac')
1129 select case (trim(nam%nicas_interp))
1130 case (
'bilin',
'natural')
1132 call mpl%abort(
'wrong interpolation for NICAS')
1137 if (nam%new_obsop)
then 1138 select case (trim(nam%obsdis))
1140 case (
'random',
'local',
'adjusted')
1141 if (trim(nam%model)==
'online')
call mpl%abort(
'modified distribution of observations only available for offline execution')
1143 call mpl%abort(
'wrong observation distribution')
1145 select case (trim(nam%obsop_interp))
1146 case (
'bilin',
'natural')
1148 call mpl%abort(
'wrong interpolation for observation operator')
1153 if (nam%new_hdiag)
then 1154 if (nam%local_diag)
then 1155 if (nam%nldwh<0)
call mpl%abort(
'nldwh should be non-negative')
1156 if (nam%nldwh>0)
then 1157 if (any(nam%il_ldwh(1:nam%nldwh)<0))
call mpl%abort(
'il_ldwh should be non-negative')
1158 if (any(nam%il_ldwh(1:nam%nldwh)>nam%nl))
call mpl%abort(
'il_ldwh should be lower than nl')
1159 if (any(nam%ic_ldwh(1:nam%nldwh)<0))
call mpl%abort(
'ic_ldwh should be non-negative')
1160 if (any(nam%ic_ldwh(1:nam%nldwh)>nam%nc3))
call mpl%abort(
'ic_ldwh should be lower than nc3')
1162 if (nam%nldwv<0)
call mpl%abort(
'nldwv should be non-negative')
1163 if (nam%nldwv>0)
then 1164 if (any(nam%lon_ldwv(1:nam%nldwv)<-180.0).or.any(nam%lon_ldwv(1:nam%nldwv)>180.0))
call mpl%abort(
'wrong lon_ldwv')
1165 if (any(nam%lat_ldwv(1:nam%nldwv)<-90.0).or.any(nam%lat_ldwv(1:nam%nldwv)>90.0))
call mpl%abort(
'wrong lat_ldwv')
1168 if (nam%local_diag.or.nam%displ_diag)
then 1169 if (nam%diag_rhflt<0.0)
call mpl%abort(
'diag_rhflt should be non-negative')
1172 if (nam%new_hdiag.or.nam%new_lct)
then 1173 select case (trim(nam%diag_interp))
1174 case (
'bilin',
'natural')
1176 call mpl%abort(
'wrong interpolation for diagnostics')
1179 if (nam%new_hdiag.or.nam%new_nicas.or.nam%check_adjoints.or.nam%check_pos_def.or.nam%check_sqrt.or.nam%check_dirac &
1180 & .or.nam%check_randomization.or.nam%check_consistency.or.nam%check_optimality.or.nam%new_lct)
then 1181 if (nam%grid_output)
then 1182 if (.not.(nam%grid_resol>0.0))
call mpl%abort(
'grid_resol should be positive')
1183 select case (trim(nam%grid_interp))
1184 case (
'bilin',
'natural')
1186 call mpl%abort(
'wrong interpolation for fields regridding')
1202 class(nam_type),
intent(in) :: nam
1203 type(mpl_type),
intent(in) :: mpl
1204 integer,
intent(in) :: ncid
1207 real(kind_real),
allocatable :: londir(:),latdir(:),lon_ldwv(:),lat_ldwv(:)
1210 call put_att(mpl,ncid,
'datadir',trim(nam%datadir))
1211 call put_att(mpl,ncid,
'prefix',trim(nam%prefix))
1212 call put_att(mpl,ncid,
'model',trim(nam%model))
1213 call put_att(mpl,ncid,
'colorlog',nam%colorlog)
1214 call put_att(mpl,ncid,
'default_seed',nam%default_seed)
1217 call put_att(mpl,ncid,
'method',trim(nam%method))
1218 call put_att(mpl,ncid,
'strategy',trim(nam%strategy))
1219 call put_att(mpl,ncid,
'new_vbal',nam%new_vbal)
1220 call put_att(mpl,ncid,
'load_vbal',nam%load_vbal)
1221 call put_att(mpl,ncid,
'new_hdiag',nam%new_hdiag)
1222 call put_att(mpl,ncid,
'new_lct',nam%new_lct)
1223 call put_att(mpl,ncid,
'load_cmat',nam%load_cmat)
1224 call put_att(mpl,ncid,
'new_nicas',nam%new_nicas)
1225 call put_att(mpl,ncid,
'load_nicas',nam%load_nicas)
1226 call put_att(mpl,ncid,
'new_obsop',nam%new_obsop)
1227 call put_att(mpl,ncid,
'load_obsop',nam%load_obsop)
1228 call put_att(mpl,ncid,
'check_vbal',nam%check_vbal)
1229 call put_att(mpl,ncid,
'check_adjoints',nam%check_adjoints)
1230 call put_att(mpl,ncid,
'check_pos_def',nam%check_pos_def)
1231 call put_att(mpl,ncid,
'check_sqrt',nam%check_sqrt)
1232 call put_att(mpl,ncid,
'check_dirac',nam%check_dirac)
1233 call put_att(mpl,ncid,
'check_randomization',nam%check_randomization)
1234 call put_att(mpl,ncid,
'check_consistency',nam%check_consistency)
1235 call put_att(mpl,ncid,
'check_optimality',nam%check_optimality)
1236 call put_att(mpl,ncid,
'check_obsop',nam%check_obsop)
1239 call put_att(mpl,ncid,
'nl',nam%nl)
1240 call put_att(mpl,ncid,
'levs',nam%nl,nam%levs(1:nam%nl))
1241 call put_att(mpl,ncid,
'logpres',nam%logpres)
1242 call put_att(mpl,ncid,
'nv',nam%nv)
1243 call put_att(mpl,ncid,
'varname',nam%nv,nam%varname(1:nam%nv))
1244 call put_att(mpl,ncid,
'addvar2d',nam%nv,nam%addvar2d(1:nam%nv))
1245 call put_att(mpl,ncid,
'nts',nam%nts)
1246 call put_att(mpl,ncid,
'timeslot',nam%nts,nam%timeslot(1:nam%nts))
1249 call put_att(mpl,ncid,
'ens1_ne',nam%ens1_ne)
1250 call put_att(mpl,ncid,
'ens1_ne_offset',nam%ens1_ne_offset)
1251 call put_att(mpl,ncid,
'ens1_nsub',nam%ens1_nsub)
1254 call put_att(mpl,ncid,
'ens2_ne',nam%ens2_ne)
1255 call put_att(mpl,ncid,
'ens2_ne_offset',nam%ens2_ne_offset)
1256 call put_att(mpl,ncid,
'ens2_nsub',nam%ens2_nsub)
1259 call put_att(mpl,ncid,
'sam_write',nam%sam_write)
1260 call put_att(mpl,ncid,
'sam_read',nam%sam_read)
1261 call put_att(mpl,ncid,
'mask_type',nam%mask_type)
1262 call put_att(mpl,ncid,
'mask_th',nam%mask_th)
1263 call put_att(mpl,ncid,
'mask_check',nam%mask_check)
1264 call put_att(mpl,ncid,
'draw_type',nam%draw_type)
1265 call put_att(mpl,ncid,
'nc1',nam%nc1)
1266 call put_att(mpl,ncid,
'ntry',nam%ntry)
1267 call put_att(mpl,ncid,
'nrep',nam%nrep)
1268 call put_att(mpl,ncid,
'nc3',nam%nc3)
1270 call put_att(mpl,ncid,
'nl0r',nam%nl0r)
1273 if (nam%nv>1)
call put_att(mpl,ncid,
'vbal_block',nam%nv*(nam%nv-1)/2,nam%vbal_block(1:nam%nv*(nam%nv-1)/2))
1276 call put_att(mpl,ncid,
'ne',nam%ne)
1277 call put_att(mpl,ncid,
'gau_approx',nam%gau_approx)
1278 call put_att(mpl,ncid,
'var_diag',nam%var_diag)
1279 call put_att(mpl,ncid,
'var_filter',nam%var_filter)
1280 call put_att(mpl,ncid,
'var_full',nam%var_full)
1281 call put_att(mpl,ncid,
'var_niter',nam%var_niter)
1282 call put_att(mpl,ncid,
'var_rhflt',nam%var_rhflt*
req)
1283 call put_att(mpl,ncid,
'local_diag',nam%local_diag)
1284 call put_att(mpl,ncid,
'local_rad',nam%local_rad*
req)
1285 call put_att(mpl,ncid,
'displ_diag',nam%displ_diag)
1286 call put_att(mpl,ncid,
'displ_rad',nam%displ_rad*
req)
1287 call put_att(mpl,ncid,
'displ_niter',nam%displ_niter)
1288 call put_att(mpl,ncid,
'displ_rhflt',nam%displ_rhflt*
req)
1289 call put_att(mpl,ncid,
'displ_tol',nam%displ_tol)
1292 call put_att(mpl,ncid,
'minim_algo',nam%minim_algo)
1293 call put_att(mpl,ncid,
'double_fit',nam%nv+1,nam%double_fit(0:nam%nv))
1294 call put_att(mpl,ncid,
'lhomh',nam%lhomh)
1295 call put_att(mpl,ncid,
'lhomv',nam%lhomv)
1296 call put_att(mpl,ncid,
'rvflt',nam%rvflt)
1297 call put_att(mpl,ncid,
'lct_nscales',nam%lct_nscales)
1298 call put_att(mpl,ncid,
'lct_diag',nam%lct_nscales,nam%lct_diag)
1301 call put_att(mpl,ncid,
'lsqrt',nam%lsqrt)
1302 call put_att(mpl,ncid,
'resol',nam%resol)
1303 call put_att(mpl,ncid,
'fast_sampling',nam%fast_sampling)
1304 call put_att(mpl,ncid,
'nicas_interp',nam%nicas_interp)
1305 call put_att(mpl,ncid,
'network',nam%network)
1306 call put_att(mpl,ncid,
'mpicom',nam%mpicom)
1307 call put_att(mpl,ncid,
'advmode',nam%advmode)
1308 call put_att(mpl,ncid,
'ndir',nam%ndir)
1309 if (nam%ndir>0)
then 1310 allocate(londir(nam%ndir))
1311 allocate(latdir(nam%ndir))
1312 londir = nam%londir(1:nam%ndir)*
rad2deg 1313 latdir = nam%latdir(1:nam%ndir)*
rad2deg 1314 call put_att(mpl,ncid,
'londir',nam%ndir,londir)
1315 call put_att(mpl,ncid,
'latdir',nam%ndir,latdir)
1316 call put_att(mpl,ncid,
'levdir',nam%ndir,nam%levdir(1:nam%ndir))
1317 call put_att(mpl,ncid,
'ivdir',nam%ndir,nam%ivdir(1:nam%ndir))
1318 call put_att(mpl,ncid,
'itsdir',nam%ndir,nam%itsdir(1:nam%ndir))
1322 call put_att(mpl,ncid,
'nobs',nam%nobs)
1323 call put_att(mpl,ncid,
'obsdis',nam%obsdis)
1324 call put_att(mpl,ncid,
'obsop_interp',nam%obsop_interp)
1327 call put_att(mpl,ncid,
'nldwh',nam%nldwh)
1328 if (nam%nldwh>0)
then 1329 call put_att(mpl,ncid,
'il_ldwh',nam%nldwh,nam%il_ldwh(1:nam%nldwh))
1330 call put_att(mpl,ncid,
'ic_ldwh',nam%nldwh,nam%ic_ldwh(1:nam%nldwh))
1332 call put_att(mpl,ncid,
'nldwv',nam%nldwv)
1333 if (nam%nldwv>0)
then 1334 allocate(lon_ldwv(nam%nldwv))
1335 allocate(lat_ldwv(nam%nldwv))
1336 lon_ldwv = nam%lon_ldwv(1:nam%nldwv)*
rad2deg 1337 lat_ldwv = nam%lat_ldwv(1:nam%nldwv)*
rad2deg 1338 call put_att(mpl,ncid,
'lon_ldwv',nam%nldwv,lon_ldwv)
1339 call put_att(mpl,ncid,
'lat_ldwv',nam%nldwv,lat_ldwv)
1341 call put_att(mpl,ncid,
'diag_rhflt',nam%diag_rhflt*
req)
1342 call put_att(mpl,ncid,
'diag_interp',nam%diag_interp)
1343 call put_att(mpl,ncid,
'field_io',nam%field_io)
1344 call put_att(mpl,ncid,
'split_io',nam%split_io)
1345 call put_att(mpl,ncid,
'grid_output',nam%grid_output)
1346 call put_att(mpl,ncid,
'grid_resol',nam%grid_resol*
req)
1347 call put_att(mpl,ncid,
'grid_interp',nam%grid_interp)
subroutine check(action, status)
subroutine nam_read(nam, mpl, namelname)
integer, parameter, public nlmax
subroutine nam_ncwrite(nam, mpl, ncid)
integer, parameter, public nldwvmax
real(kind=kind_real), parameter req
Earth radius at equator (m)
subroutine nam_bcast(nam, mpl)
integer, parameter, public ntsmax
integer, parameter, public nc3max
integer, parameter, public nvmax
subroutine nam_setup_internal(nam, nl0, nv, nts, ens1_ne, ens1_nsub, ens2_ne, ens2_nsub)
integer, parameter, public ndirmax
integer, parameter, public nscalesmax
integer, parameter, public kind_real
subroutine nam_check(nam, mpl)