diff --git a/.gitignore b/.gitignore index 3733d2bc0..81f49c91e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,12 @@ -include/*.mod +build +lib +include +external/**/*.mod +external/**/*.o +Srcfiles interface/framework/*.mod interface/framework/*.o interface/model/*.mod interface/model/*.o -lib/lib* src/*.mod -src/*.o \ No newline at end of file +src/*.o diff --git a/Depends b/Depends new file mode 100644 index 000000000..76e1c4484 --- /dev/null +++ b/Depends @@ -0,0 +1,422 @@ +$(OBJDIR)/PDAF_3dvar_alloc.o: ./src/PDAF_3dvar_alloc.F90 $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_3dvar_analysis_cvt.o: ./src/PDAF_3dvar_analysis_cvt.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o ./src/typedefs.h +$(OBJDIR)/PDAF_3dvar_costf_cg_cvt.o: ./src/PDAF_3dvar_costf_cg_cvt.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o ./src/typedefs.h +$(OBJDIR)/PDAF_3dvar_costf_cvt.o: ./src/PDAF_3dvar_costf_cvt.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o ./src/typedefs.h +$(OBJDIR)/PDAF_3dvar_init.o: ./src/PDAF_3dvar_init.F90 $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_3dvar_memtime.o: ./src/PDAF_3dvar_memtime.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAFomi.o $(OBJDIR)/PDAFlocal.o +$(OBJDIR)/PDAF_3dvar_optim_cg.o: ./src/PDAF_3dvar_optim_cg.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o ./src/typedefs.h +$(OBJDIR)/PDAF_3dvar_optim_cgplus.o: ./src/PDAF_3dvar_optim_cgplus.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_3dvar_optim_lbfgs.o: ./src/PDAF_3dvar_optim_lbfgs.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_3dvar_options.o: ./src/PDAF_3dvar_options.F90 +$(OBJDIR)/PDAF_3dvar_update.o: ./src/PDAF_3dvar_update.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_add_increment.o: ./src/PDAF_add_increment.F90 $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_alloc_filters.o: ./src/PDAF_alloc_filters.F90 +$(OBJDIR)/PDAF_allreduce.o: ./src/PDAF_allreduce.F90 $(OBJDIR)/PDAF_mod_filtermpi.o ./src/typedefs.h +$(OBJDIR)/PDAF_analysis_utils.o: ./src/PDAF_analysis_utils.F90 $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAFomi.o $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_assimilate_3dvar.o: ./src/PDAF_assimilate_3dvar.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_assimilate_en3dvar_estkf.o: ./src/PDAF_assimilate_en3dvar_estkf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_assimilate_en3dvar_lestkf.o: ./src/PDAF_assimilate_en3dvar_lestkf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_assimilate_enkf.o: ./src/PDAF_assimilate_enkf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_assimilate_enkf_si.o: ./src/PDAF_assimilate_enkf_si.F90 +$(OBJDIR)/PDAF_assimilate_estkf.o: ./src/PDAF_assimilate_estkf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_assimilate_estkf_si.o: ./src/PDAF_assimilate_estkf_si.F90 +$(OBJDIR)/PDAF_assimilate_etkf.o: ./src/PDAF_assimilate_etkf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_assimilate_etkf_si.o: ./src/PDAF_assimilate_etkf_si.F90 +$(OBJDIR)/PDAF_assimilate_hyb3dvar_estkf.o: ./src/PDAF_assimilate_hyb3dvar_estkf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_assimilate_hyb3dvar_lestkf.o: ./src/PDAF_assimilate_hyb3dvar_lestkf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_assimilate_lenkf.o: ./src/PDAF_assimilate_lenkf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_assimilate_lenkf_si.o: ./src/PDAF_assimilate_lenkf_si.F90 +$(OBJDIR)/PDAF_assimilate_lestkf.o: ./src/PDAF_assimilate_lestkf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_assimilate_lestkf_si.o: ./src/PDAF_assimilate_lestkf_si.F90 +$(OBJDIR)/PDAF_assimilate_letkf.o: ./src/PDAF_assimilate_letkf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_assimilate_letkf_si.o: ./src/PDAF_assimilate_letkf_si.F90 +$(OBJDIR)/PDAF_assimilate_lknetf.o: ./src/PDAF_assimilate_lknetf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_assimilate_lknetf_si.o: ./src/PDAF_assimilate_lknetf_si.F90 +$(OBJDIR)/PDAF_assimilate_lnetf.o: ./src/PDAF_assimilate_lnetf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_assimilate_lnetf_si.o: ./src/PDAF_assimilate_lnetf_si.F90 +$(OBJDIR)/PDAF_assimilate_lseik.o: ./src/PDAF_assimilate_lseik.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_assimilate_lseik_si.o: ./src/PDAF_assimilate_lseik_si.F90 +$(OBJDIR)/PDAF_assimilate_netf.o: ./src/PDAF_assimilate_netf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_assimilate_netf_si.o: ./src/PDAF_assimilate_netf_si.F90 +$(OBJDIR)/PDAF_assimilate_pf.o: ./src/PDAF_assimilate_pf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_assimilate_pf_si.o: ./src/PDAF_assimilate_pf_si.F90 +$(OBJDIR)/PDAF_assimilate_prepost.o: ./src/PDAF_assimilate_prepost.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_assimilate_prepost_si.o: ./src/PDAF_assimilate_prepost_si.F90 +$(OBJDIR)/PDAF_assimilate_seek.o: ./src/PDAF_assimilate_seek.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_assimilate_seek_si.o: ./src/PDAF_assimilate_seek_si.F90 +$(OBJDIR)/PDAF_assimilate_seik.o: ./src/PDAF_assimilate_seik.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_assimilate_seik_si.o: ./src/PDAF_assimilate_seik_si.F90 +$(OBJDIR)/PDAF_communicate_ens.o: ./src/PDAF_communicate_ens.F90 $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_mod_filter.o ./src/typedefs.h +$(OBJDIR)/PDAF_correlation_function.o: ./src/PDAF_correlation_function.F90 +$(OBJDIR)/PDAF_deallocate.o: ./src/PDAF_deallocate.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_diag_crps.o: ./src/PDAF_diag_crps.F90 $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/SANGOMA_quicksort.o ./src/typedefs.h +$(OBJDIR)/PDAF_diag_effsample.o: ./src/PDAF_diag_effsample.F90 +$(OBJDIR)/PDAF_diag_ensstats.o: ./src/PDAF_diag_ensstats.F90 ./src/typedefs.h +$(OBJDIR)/PDAF_diag_histogram.o: ./src/PDAF_diag_histogram.F90 ./src/typedefs.h +$(OBJDIR)/PDAF_en3dvar_analysis_cvt.o: ./src/PDAF_en3dvar_analysis_cvt.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o ./src/typedefs.h +$(OBJDIR)/PDAF_en3dvar_costf_cg_cvt.o: ./src/PDAF_en3dvar_costf_cg_cvt.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o ./src/typedefs.h +$(OBJDIR)/PDAF_en3dvar_costf_cvt.o: ./src/PDAF_en3dvar_costf_cvt.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o ./src/typedefs.h +$(OBJDIR)/PDAF_en3dvar_optim_cg.o: ./src/PDAF_en3dvar_optim_cg.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o ./src/typedefs.h +$(OBJDIR)/PDAF_en3dvar_optim_cgplus.o: ./src/PDAF_en3dvar_optim_cgplus.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_en3dvar_optim_lbfgs.o: ./src/PDAF_en3dvar_optim_lbfgs.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_en3dvar_update_estkf.o: ./src/PDAF_en3dvar_update_estkf.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_en3dvar_update_lestkf.o: ./src/PDAF_en3dvar_update_lestkf.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAF_enkf_Tleft.o: ./src/PDAF_enkf_Tleft.F90 $(OBJDIR)/PDAF_memcount.o +$(OBJDIR)/PDAF_enkf_alloc.o: ./src/PDAF_enkf_alloc.F90 $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_enkf_analysis_rlm.o: ./src/PDAF_enkf_analysis_rlm.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAFomi.o $(OBJDIR)/PDAF_analysis_utils.o ./src/typedefs.h +$(OBJDIR)/PDAF_enkf_analysis_rsm.o: ./src/PDAF_enkf_analysis_rsm.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAFomi.o $(OBJDIR)/PDAF_analysis_utils.o ./src/typedefs.h +$(OBJDIR)/PDAF_enkf_gather_resid.o: ./src/PDAF_enkf_gather_resid.F90 $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o ./src/typedefs.h +$(OBJDIR)/PDAF_enkf_init.o: ./src/PDAF_enkf_init.F90 $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_enkf_memtime.o: ./src/PDAF_enkf_memtime.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAF_enkf_obs_ensemble.o: ./src/PDAF_enkf_obs_ensemble.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o ./src/typedefs.h +$(OBJDIR)/PDAF_enkf_omega.o: ./src/PDAF_enkf_omega.F90 ./src/typedefs.h +$(OBJDIR)/PDAF_enkf_options.o: ./src/PDAF_enkf_options.F90 +$(OBJDIR)/PDAF_enkf_update.o: ./src/PDAF_enkf_update.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_eofcovar.o: ./src/PDAF_eofcovar.F90 $(OBJDIR)/PDAF_mod_filter.o ./src/typedefs.h +$(OBJDIR)/PDAF_estkf_AOmega.o: ./src/PDAF_estkf_AOmega.F90 $(OBJDIR)/PDAF_memcount.o +$(OBJDIR)/PDAF_estkf_OmegaA.o: ./src/PDAF_estkf_OmegaA.F90 $(OBJDIR)/PDAF_memcount.o +$(OBJDIR)/PDAF_estkf_alloc.o: ./src/PDAF_estkf_alloc.F90 $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_estkf_analysis.o: ./src/PDAF_estkf_analysis.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAFomi.o ./src/typedefs.h +$(OBJDIR)/PDAF_estkf_analysis_fixed.o: ./src/PDAF_estkf_analysis_fixed.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAFomi.o ./src/typedefs.h +$(OBJDIR)/PDAF_estkf_init.o: ./src/PDAF_estkf_init.F90 $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_estkf_memtime.o: ./src/PDAF_estkf_memtime.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAF_estkf_options.o: ./src/PDAF_estkf_options.F90 +$(OBJDIR)/PDAF_estkf_update.o: ./src/PDAF_estkf_update.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_etkf_Tleft.o: ./src/PDAF_etkf_Tleft.F90 $(OBJDIR)/PDAF_memcount.o +$(OBJDIR)/PDAF_etkf_Tright.o: ./src/PDAF_etkf_Tright.F90 $(OBJDIR)/PDAF_memcount.o +$(OBJDIR)/PDAF_etkf_alloc.o: ./src/PDAF_etkf_alloc.F90 $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_etkf_analysis.o: ./src/PDAF_etkf_analysis.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o ./src/typedefs.h +$(OBJDIR)/PDAF_etkf_analysis_T.o: ./src/PDAF_etkf_analysis_T.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o ./src/typedefs.h +$(OBJDIR)/PDAF_etkf_analysis_fixed.o: ./src/PDAF_etkf_analysis_fixed.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o ./src/typedefs.h +$(OBJDIR)/PDAF_etkf_init.o: ./src/PDAF_etkf_init.F90 $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_etkf_memtime.o: ./src/PDAF_etkf_memtime.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAF_etkf_options.o: ./src/PDAF_etkf_options.F90 +$(OBJDIR)/PDAF_etkf_update.o: ./src/PDAF_etkf_update.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_force_analysis.o: ./src/PDAF_force_analysis.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_gather_dim_obs_f.o: ./src/PDAF_gather_dim_obs_f.F90 $(OBJDIR)/PDAF_mod_filtermpi.o ./src/typedefs.h +$(OBJDIR)/PDAF_gather_obs_f.o: ./src/PDAF_gather_obs_f.F90 $(OBJDIR)/PDAF_mod_filtermpi.o ./src/typedefs.h +$(OBJDIR)/PDAF_gather_obs_f2.o: ./src/PDAF_gather_obs_f2.F90 $(OBJDIR)/PDAF_mod_filtermpi.o ./src/typedefs.h +$(OBJDIR)/PDAF_gather_obs_f2_flex.o: ./src/PDAF_gather_obs_f2_flex.F90 $(OBJDIR)/PDAF_mod_filtermpi.o ./src/typedefs.h +$(OBJDIR)/PDAF_gather_obs_f_flex.o: ./src/PDAF_gather_obs_f_flex.F90 $(OBJDIR)/PDAF_mod_filtermpi.o ./src/typedefs.h +$(OBJDIR)/PDAF_gen_obs.o: ./src/PDAF_gen_obs.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o ./src/typedefs.h +$(OBJDIR)/PDAF_generate_obs.o: ./src/PDAF_generate_obs.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_generate_obs_si.o: ./src/PDAF_generate_obs_si.F90 +$(OBJDIR)/PDAF_generate_rndmat.o: ./src/PDAF_generate_rndmat.F90 ./src/typedefs.h +$(OBJDIR)/PDAF_genobs_alloc.o: ./src/PDAF_genobs_alloc.F90 $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_genobs_init.o: ./src/PDAF_genobs_init.F90 +$(OBJDIR)/PDAF_genobs_options.o: ./src/PDAF_genobs_options.F90 +$(OBJDIR)/PDAF_get_assim_flag.o: ./src/PDAF_get_assim_flag.F90 $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_get_ensstats.o: ./src/PDAF_get_ensstats.F90 $(OBJDIR)/PDAF_mod_filter.o ./src/typedefs.h +$(OBJDIR)/PDAF_get_globalobs.o: ./src/PDAF_get_globalobs.F90 $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_get_localfilter.o: ./src/PDAF_get_localfilter.F90 $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_get_memberid.o: ./src/PDAF_get_memberid.F90 $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_get_obsmemberid.o: ./src/PDAF_get_obsmemberid.F90 $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_get_smootherens.o: ./src/PDAF_get_smootherens.F90 $(OBJDIR)/PDAF_mod_filter.o ./src/typedefs.h +$(OBJDIR)/PDAF_get_state.o: ./src/PDAF_get_state.F90 $(OBJDIR)/PDAF_communicate_ens.o $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o ./src/typedefs.h +$(OBJDIR)/PDAF_get_state_si.o: ./src/PDAF_get_state_si.F90 +$(OBJDIR)/PDAF_hyb3dvar_analysis_cvt.o: ./src/PDAF_hyb3dvar_analysis_cvt.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o ./src/typedefs.h +$(OBJDIR)/PDAF_hyb3dvar_costf_cg_cvt.o: ./src/PDAF_hyb3dvar_costf_cg_cvt.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o ./src/typedefs.h +$(OBJDIR)/PDAF_hyb3dvar_costf_cvt.o: ./src/PDAF_hyb3dvar_costf_cvt.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o ./src/typedefs.h +$(OBJDIR)/PDAF_hyb3dvar_optim_cg.o: ./src/PDAF_hyb3dvar_optim_cg.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o ./src/typedefs.h +$(OBJDIR)/PDAF_hyb3dvar_optim_cgplus.o: ./src/PDAF_hyb3dvar_optim_cgplus.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_hyb3dvar_optim_lbfgs.o: ./src/PDAF_hyb3dvar_optim_lbfgs.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_hyb3dvar_update_estkf.o: ./src/PDAF_hyb3dvar_update_estkf.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_hyb3dvar_update_lestkf.o: ./src/PDAF_hyb3dvar_update_lestkf.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAF_incremental.o: ./src/PDAF_incremental.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_incremental_si.o: ./src/PDAF_incremental_si.F90 +$(OBJDIR)/PDAF_inflate_ens.o: ./src/PDAF_inflate_ens.F90 $(OBJDIR)/PDAF_memcount.o +$(OBJDIR)/PDAF_inflate_weights.o: ./src/PDAF_inflate_weights.F90 +$(OBJDIR)/PDAF_init.o: ./src/PDAF_init.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_init_filters.o: ./src/PDAF_init_filters.F90 $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_init_si.o: ./src/PDAF_init_si.F90 +$(OBJDIR)/PDAF_interfaces_module.o: ./src/PDAF_interfaces_module.F90 $(OBJDIR)/PDAFlocal_interfaces.o $(OBJDIR)/PDAF_mod_filtermpi.o ./src/typedefs.h +$(OBJDIR)/PDAF_lenkf_alloc.o: ./src/PDAF_lenkf_alloc.F90 $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_lenkf_analysis_rsm.o: ./src/PDAF_lenkf_analysis_rsm.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAFomi.o $(OBJDIR)/PDAF_analysis_utils.o ./src/typedefs.h +$(OBJDIR)/PDAF_lenkf_init.o: ./src/PDAF_lenkf_init.F90 $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_lenkf_memtime.o: ./src/PDAF_lenkf_memtime.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAF_lenkf_options.o: ./src/PDAF_lenkf_options.F90 +$(OBJDIR)/PDAF_lenkf_update.o: ./src/PDAF_lenkf_update.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_lestkf_alloc.o: ./src/PDAF_lestkf_alloc.F90 $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_lestkf_analysis.o: ./src/PDAF_lestkf_analysis.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o ./src/typedefs.h +$(OBJDIR)/PDAF_lestkf_analysis_fixed.o: ./src/PDAF_lestkf_analysis_fixed.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o ./src/typedefs.h +$(OBJDIR)/PDAF_lestkf_init.o: ./src/PDAF_lestkf_init.F90 $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_lestkf_memtime.o: ./src/PDAF_lestkf_memtime.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAFomi.o $(OBJDIR)/PDAFlocal.o +$(OBJDIR)/PDAF_lestkf_options.o: ./src/PDAF_lestkf_options.F90 +$(OBJDIR)/PDAF_lestkf_update.o: ./src/PDAF_lestkf_update.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_analysis_utils.o +$(OBJDIR)/PDAF_letkf_alloc.o: ./src/PDAF_letkf_alloc.F90 $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_letkf_analysis.o: ./src/PDAF_letkf_analysis.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o ./src/typedefs.h +$(OBJDIR)/PDAF_letkf_analysis_T.o: ./src/PDAF_letkf_analysis_T.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o ./src/typedefs.h +$(OBJDIR)/PDAF_letkf_analysis_fixed.o: ./src/PDAF_letkf_analysis_fixed.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o ./src/typedefs.h +$(OBJDIR)/PDAF_letkf_init.o: ./src/PDAF_letkf_init.F90 $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_letkf_memtime.o: ./src/PDAF_letkf_memtime.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAFomi.o $(OBJDIR)/PDAFlocal.o +$(OBJDIR)/PDAF_letkf_options.o: ./src/PDAF_letkf_options.F90 +$(OBJDIR)/PDAF_letkf_update.o: ./src/PDAF_letkf_update.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_analysis_utils.o +$(OBJDIR)/PDAF_lknetf_alloc.o: ./src/PDAF_lknetf_alloc.F90 $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_lknetf_alpha_neff.o: ./src/PDAF_lknetf_alpha_neff.F90 +$(OBJDIR)/PDAF_lknetf_ana_letkfT.o: ./src/PDAF_lknetf_ana_letkfT.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o ./src/typedefs.h +$(OBJDIR)/PDAF_lknetf_ana_lnetf.o: ./src/PDAF_lknetf_ana_lnetf.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o ./src/typedefs.h +$(OBJDIR)/PDAF_lknetf_analysis_T.o: ./src/PDAF_lknetf_analysis_T.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o ./src/typedefs.h +$(OBJDIR)/PDAF_lknetf_compute_gamma.o: ./src/PDAF_lknetf_compute_gamma.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o ./src/typedefs.h +$(OBJDIR)/PDAF_lknetf_init.o: ./src/PDAF_lknetf_init.F90 $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_lknetf_memtime.o: ./src/PDAF_lknetf_memtime.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAFomi.o $(OBJDIR)/PDAFlocal.o +$(OBJDIR)/PDAF_lknetf_options.o: ./src/PDAF_lknetf_options.F90 +$(OBJDIR)/PDAF_lknetf_reset_gamma.o: ./src/PDAF_lknetf_reset_gamma.F90 $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_lknetf_set_gamma.o: ./src/PDAF_lknetf_set_gamma.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o ./src/typedefs.h +$(OBJDIR)/PDAF_lknetf_step_update.o: ./src/PDAF_lknetf_step_update.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_analysis_utils.o ./src/typedefs.h +$(OBJDIR)/PDAF_lknetf_update.o: ./src/PDAF_lknetf_update.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_analysis_utils.o ./src/typedefs.h +$(OBJDIR)/PDAF_lnetf_alloc.o: ./src/PDAF_lnetf_alloc.F90 $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_lnetf_analysis.o: ./src/PDAF_lnetf_analysis.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o ./src/typedefs.h +$(OBJDIR)/PDAF_lnetf_init.o: ./src/PDAF_lnetf_init.F90 $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_lnetf_memtime.o: ./src/PDAF_lnetf_memtime.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAFomi.o $(OBJDIR)/PDAFlocal.o +$(OBJDIR)/PDAF_lnetf_options.o: ./src/PDAF_lnetf_options.F90 +$(OBJDIR)/PDAF_lnetf_smootherT.o: ./src/PDAF_lnetf_smootherT.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o ./src/typedefs.h +$(OBJDIR)/PDAF_lnetf_update.o: ./src/PDAF_lnetf_update.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_analysis_utils.o ./src/typedefs.h +$(OBJDIR)/PDAF_local_weight.o: ./src/PDAF_local_weight.F90 +$(OBJDIR)/PDAF_local_weights.o: ./src/PDAF_local_weights.F90 +$(OBJDIR)/PDAF_lseik_alloc.o: ./src/PDAF_lseik_alloc.F90 $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_lseik_analysis.o: ./src/PDAF_lseik_analysis.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o ./src/typedefs.h +$(OBJDIR)/PDAF_lseik_analysis_trans.o: ./src/PDAF_lseik_analysis_trans.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAFomi.o ./src/typedefs.h +$(OBJDIR)/PDAF_lseik_init.o: ./src/PDAF_lseik_init.F90 $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_lseik_memtime.o: ./src/PDAF_lseik_memtime.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAFomi.o $(OBJDIR)/PDAFlocal.o +$(OBJDIR)/PDAF_lseik_options.o: ./src/PDAF_lseik_options.F90 +$(OBJDIR)/PDAF_lseik_resample.o: ./src/PDAF_lseik_resample.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o ./src/typedefs.h +$(OBJDIR)/PDAF_lseik_update.o: ./src/PDAF_lseik_update.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_analysis_utils.o +$(OBJDIR)/PDAF_memcount.o: ./src/PDAF_memcount.F90 ./src/typedefs.h +$(OBJDIR)/PDAF_mod_filter.o: ./src/PDAF_mod_filter.F90 +$(OBJDIR)/PDAF_mod_filtermpi.o: ./src/PDAF_mod_filtermpi.F90 +$(OBJDIR)/PDAF_mod_lnetf.o: ./src/PDAF_mod_lnetf.F90 $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_mvnormalize.o: ./src/PDAF_mvnormalize.F90 ./src/typedefs.h +$(OBJDIR)/PDAF_netf_alloc.o: ./src/PDAF_netf_alloc.F90 $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_netf_analysis.o: ./src/PDAF_netf_analysis.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o $(OBJDIR)/PDAF_analysis_utils.o ./src/typedefs.h +$(OBJDIR)/PDAF_netf_init.o: ./src/PDAF_netf_init.F90 $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_netf_memtime.o: ./src/PDAF_netf_memtime.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAF_netf_options.o: ./src/PDAF_netf_options.F90 +$(OBJDIR)/PDAF_netf_smootherT.o: ./src/PDAF_netf_smootherT.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_mod_filtermpi.o ./src/typedefs.h +$(OBJDIR)/PDAF_netf_update.o: ./src/PDAF_netf_update.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_options_filters.o: ./src/PDAF_options_filters.F90 $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_pf_add_noise.o: ./src/PDAF_pf_add_noise.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o ./src/typedefs.h +$(OBJDIR)/PDAF_pf_alloc.o: ./src/PDAF_pf_alloc.F90 $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_pf_analysis.o: ./src/PDAF_pf_analysis.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o $(OBJDIR)/PDAF_analysis_utils.o ./src/typedefs.h +$(OBJDIR)/PDAF_pf_init.o: ./src/PDAF_pf_init.F90 $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_pf_memtime.o: ./src/PDAF_pf_memtime.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAF_pf_options.o: ./src/PDAF_pf_options.F90 +$(OBJDIR)/PDAF_pf_resampling.o: ./src/PDAF_pf_resampling.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o ./src/typedefs.h +$(OBJDIR)/PDAF_pf_update.o: ./src/PDAF_pf_update.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_prepost.o: ./src/PDAF_prepost.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_prepost_si.o: ./src/PDAF_prepost_si.F90 +$(OBJDIR)/PDAF_print_info.o: ./src/PDAF_print_info.F90 $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_print_version.o: ./src/PDAF_print_version.F90 $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_put_state_3dvar.o: ./src/PDAF_put_state_3dvar.F90 $(OBJDIR)/PDAF_communicate_ens.o $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_put_state_en3dvar_estkf.o: ./src/PDAF_put_state_en3dvar_estkf.F90 $(OBJDIR)/PDAF_communicate_ens.o $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_put_state_en3dvar_lestkf.o: ./src/PDAF_put_state_en3dvar_lestkf.F90 $(OBJDIR)/PDAF_communicate_ens.o $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_put_state_enkf.o: ./src/PDAF_put_state_enkf.F90 $(OBJDIR)/PDAF_communicate_ens.o $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_put_state_enkf_si.o: ./src/PDAF_put_state_enkf_si.F90 +$(OBJDIR)/PDAF_put_state_estkf.o: ./src/PDAF_put_state_estkf.F90 $(OBJDIR)/PDAF_communicate_ens.o $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_put_state_estkf_si.o: ./src/PDAF_put_state_estkf_si.F90 +$(OBJDIR)/PDAF_put_state_etkf.o: ./src/PDAF_put_state_etkf.F90 $(OBJDIR)/PDAF_communicate_ens.o $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_put_state_etkf_si.o: ./src/PDAF_put_state_etkf_si.F90 +$(OBJDIR)/PDAF_put_state_generate_obs.o: ./src/PDAF_put_state_generate_obs.F90 $(OBJDIR)/PDAF_communicate_ens.o $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_put_state_generate_obs_si.o: ./src/PDAF_put_state_generate_obs_si.F90 +$(OBJDIR)/PDAF_put_state_hyb3dvar_estkf.o: ./src/PDAF_put_state_hyb3dvar_estkf.F90 $(OBJDIR)/PDAF_communicate_ens.o $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_put_state_hyb3dvar_lestkf.o: ./src/PDAF_put_state_hyb3dvar_lestkf.F90 $(OBJDIR)/PDAF_communicate_ens.o $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_put_state_lenkf.o: ./src/PDAF_put_state_lenkf.F90 $(OBJDIR)/PDAF_communicate_ens.o $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_put_state_lenkf_si.o: ./src/PDAF_put_state_lenkf_si.F90 +$(OBJDIR)/PDAF_put_state_lestkf.o: ./src/PDAF_put_state_lestkf.F90 $(OBJDIR)/PDAF_communicate_ens.o $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_put_state_lestkf_si.o: ./src/PDAF_put_state_lestkf_si.F90 +$(OBJDIR)/PDAF_put_state_letkf.o: ./src/PDAF_put_state_letkf.F90 $(OBJDIR)/PDAF_communicate_ens.o $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_put_state_letkf_si.o: ./src/PDAF_put_state_letkf_si.F90 +$(OBJDIR)/PDAF_put_state_lknetf.o: ./src/PDAF_put_state_lknetf.F90 $(OBJDIR)/PDAF_communicate_ens.o $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_put_state_lknetf_si.o: ./src/PDAF_put_state_lknetf_si.F90 +$(OBJDIR)/PDAF_put_state_lnetf.o: ./src/PDAF_put_state_lnetf.F90 $(OBJDIR)/PDAF_communicate_ens.o $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_put_state_lnetf_si.o: ./src/PDAF_put_state_lnetf_si.F90 +$(OBJDIR)/PDAF_put_state_lseik.o: ./src/PDAF_put_state_lseik.F90 $(OBJDIR)/PDAF_communicate_ens.o $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_put_state_lseik_si.o: ./src/PDAF_put_state_lseik_si.F90 +$(OBJDIR)/PDAF_put_state_netf.o: ./src/PDAF_put_state_netf.F90 $(OBJDIR)/PDAF_communicate_ens.o $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_put_state_netf_si.o: ./src/PDAF_put_state_netf_si.F90 +$(OBJDIR)/PDAF_put_state_pf.o: ./src/PDAF_put_state_pf.F90 $(OBJDIR)/PDAF_communicate_ens.o $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_put_state_pf_si.o: ./src/PDAF_put_state_pf_si.F90 +$(OBJDIR)/PDAF_put_state_prepost.o: ./src/PDAF_put_state_prepost.F90 $(OBJDIR)/PDAF_communicate_ens.o $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_put_state_prepost_si.o: ./src/PDAF_put_state_prepost_si.F90 +$(OBJDIR)/PDAF_put_state_seek.o: ./src/PDAF_put_state_seek.F90 $(OBJDIR)/PDAF_communicate_ens.o $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o ./src/typedefs.h +$(OBJDIR)/PDAF_put_state_seek_si.o: ./src/PDAF_put_state_seek_si.F90 +$(OBJDIR)/PDAF_put_state_seik.o: ./src/PDAF_put_state_seik.F90 $(OBJDIR)/PDAF_communicate_ens.o $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_put_state_seik_si.o: ./src/PDAF_put_state_seik_si.F90 +$(OBJDIR)/PDAF_reset_dim_p.o: ./src/PDAF_reset_dim_p.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_reset_forget.o: ./src/PDAF_reset_forget.F90 $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_sampleens.o: ./src/PDAF_sampleens.F90 $(OBJDIR)/PDAF_mod_filter.o ./src/typedefs.h +$(OBJDIR)/PDAF_seek_alloc.o: ./src/PDAF_seek_alloc.F90 $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_seek_analysis.o: ./src/PDAF_seek_analysis.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o ./src/typedefs.h +$(OBJDIR)/PDAF_seek_init.o: ./src/PDAF_seek_init.F90 $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_seek_memtime.o: ./src/PDAF_seek_memtime.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_seek_options.o: ./src/PDAF_seek_options.F90 +$(OBJDIR)/PDAF_seek_rediag.o: ./src/PDAF_seek_rediag.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o ./src/typedefs.h +$(OBJDIR)/PDAF_seek_update.o: ./src/PDAF_seek_update.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_seik_TtimesA.o: ./src/PDAF_seik_TtimesA.F90 $(OBJDIR)/PDAF_memcount.o +$(OBJDIR)/PDAF_seik_alloc.o: ./src/PDAF_seik_alloc.F90 $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_seik_analysis.o: ./src/PDAF_seik_analysis.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAFomi.o ./src/typedefs.h +$(OBJDIR)/PDAF_seik_analysis_newT.o: ./src/PDAF_seik_analysis_newT.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAFomi.o ./src/typedefs.h +$(OBJDIR)/PDAF_seik_analysis_trans.o: ./src/PDAF_seik_analysis_trans.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAFomi.o ./src/typedefs.h +$(OBJDIR)/PDAF_seik_init.o: ./src/PDAF_seik_init.F90 $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_seik_matrixT.o: ./src/PDAF_seik_matrixT.F90 $(OBJDIR)/PDAF_memcount.o +$(OBJDIR)/PDAF_seik_memtime.o: ./src/PDAF_seik_memtime.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAF_seik_omega.o: ./src/PDAF_seik_omega.F90 $(OBJDIR)/PDAF_mod_filtermpi.o ./src/typedefs.h +$(OBJDIR)/PDAF_seik_options.o: ./src/PDAF_seik_options.F90 +$(OBJDIR)/PDAF_seik_resample.o: ./src/PDAF_seik_resample.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o ./src/typedefs.h +$(OBJDIR)/PDAF_seik_resample_newT.o: ./src/PDAF_seik_resample_newT.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o ./src/typedefs.h +$(OBJDIR)/PDAF_seik_uinv.o: ./src/PDAF_seik_uinv.F90 $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_seik_update.o: ./src/PDAF_seik_update.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_set_comm_pdaf.o: ./src/PDAF_set_comm_pdaf.F90 $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_set_debug_flag.o: ./src/PDAF_set_debug_flag.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_set_ens_pointer.o: ./src/PDAF_set_ens_pointer.F90 $(OBJDIR)/PDAF_mod_filter.o ./src/typedefs.h +$(OBJDIR)/PDAF_set_forget.o: ./src/PDAF_set_forget.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_mod_filtermpi.o ./src/typedefs.h +$(OBJDIR)/PDAF_set_forget_local.o: ./src/PDAF_set_forget_local.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAF_set_memberid.o: ./src/PDAF_set_memberid.F90 $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_set_offline_mode.o: ./src/PDAF_set_offline_mode.F90 $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAF_set_smootherens.o: ./src/PDAF_set_smootherens.F90 $(OBJDIR)/PDAF_mod_filter.o ./src/typedefs.h +$(OBJDIR)/PDAF_smoother.o: ./src/PDAF_smoother.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o ./src/typedefs.h +$(OBJDIR)/PDAF_smoother_enkf.o: ./src/PDAF_smoother_enkf.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o ./src/typedefs.h +$(OBJDIR)/PDAF_smoother_lnetf.o: ./src/PDAF_smoother_lnetf.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o ./src/typedefs.h +$(OBJDIR)/PDAF_smoother_local.o: ./src/PDAF_smoother_local.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o ./src/typedefs.h +$(OBJDIR)/PDAF_smoother_netf.o: ./src/PDAF_smoother_netf.F90 $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filtermpi.o ./src/typedefs.h +$(OBJDIR)/PDAF_smoother_shift.o: ./src/PDAF_smoother_shift.F90 $(OBJDIR)/PDAF_mod_filtermpi.o ./src/typedefs.h +$(OBJDIR)/PDAF_timer.o: ./src/PDAF_timer.F90 +$(OBJDIR)/PDAF_timer_mpi.o: ./src/PDAF_timer_mpi.F90 +$(OBJDIR)/PDAFlocal.o: ./src/PDAFlocal.F90 $(OBJDIR)/PDAFlocal_interfaces.o +$(OBJDIR)/PDAFlocal_assimilate_en3dvar_lestkf.o: ./src/PDAFlocal_assimilate_en3dvar_lestkf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAFlocal_assimilate_hyb3dvar_lestkf.o: ./src/PDAFlocal_assimilate_hyb3dvar_lestkf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAFlocal_assimilate_lestkf.o: ./src/PDAFlocal_assimilate_lestkf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAFlocal_assimilate_lestkf_si.o: ./src/PDAFlocal_assimilate_lestkf_si.F90 +$(OBJDIR)/PDAFlocal_assimilate_letkf.o: ./src/PDAFlocal_assimilate_letkf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAFlocal_assimilate_letkf_si.o: ./src/PDAFlocal_assimilate_letkf_si.F90 +$(OBJDIR)/PDAFlocal_assimilate_lknetf.o: ./src/PDAFlocal_assimilate_lknetf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAFlocal_assimilate_lknetf_si.o: ./src/PDAFlocal_assimilate_lknetf_si.F90 +$(OBJDIR)/PDAFlocal_assimilate_lnetf.o: ./src/PDAFlocal_assimilate_lnetf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAFlocal_assimilate_lnetf_si.o: ./src/PDAFlocal_assimilate_lnetf_si.F90 +$(OBJDIR)/PDAFlocal_assimilate_lseik.o: ./src/PDAFlocal_assimilate_lseik.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAFlocal_assimilate_lseik_si.o: ./src/PDAFlocal_assimilate_lseik_si.F90 +$(OBJDIR)/PDAFlocal_clear_increment_weights.o: ./src/PDAFlocal_clear_increment_weights.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFlocal.o +$(OBJDIR)/PDAFlocal_g2l_cb.o: ./src/PDAFlocal_g2l_cb.F90 $(OBJDIR)/PDAFlocal.o +$(OBJDIR)/PDAFlocal_interfaces.o: ./src/PDAFlocal_interfaces.F90 ./src/typedefs.h +$(OBJDIR)/PDAFlocal_l2g_cb.o: ./src/PDAFlocal_l2g_cb.F90 $(OBJDIR)/PDAFlocal.o +$(OBJDIR)/PDAFlocal_put_state_en3dvar_lestkf.o: ./src/PDAFlocal_put_state_en3dvar_lestkf.F90 $(OBJDIR)/PDAF_communicate_ens.o $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAFlocal.o +$(OBJDIR)/PDAFlocal_put_state_hyb3dvar_lestkf.o: ./src/PDAFlocal_put_state_hyb3dvar_lestkf.F90 $(OBJDIR)/PDAF_communicate_ens.o $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAFlocal.o +$(OBJDIR)/PDAFlocal_put_state_lestkf.o: ./src/PDAFlocal_put_state_lestkf.F90 $(OBJDIR)/PDAF_communicate_ens.o $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAFlocal.o +$(OBJDIR)/PDAFlocal_put_state_lestkf_si.o: ./src/PDAFlocal_put_state_lestkf_si.F90 +$(OBJDIR)/PDAFlocal_put_state_letkf.o: ./src/PDAFlocal_put_state_letkf.F90 $(OBJDIR)/PDAF_communicate_ens.o $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAFlocal.o +$(OBJDIR)/PDAFlocal_put_state_letkf_si.o: ./src/PDAFlocal_put_state_letkf_si.F90 +$(OBJDIR)/PDAFlocal_put_state_lknetf.o: ./src/PDAFlocal_put_state_lknetf.F90 $(OBJDIR)/PDAF_communicate_ens.o $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAFlocal.o +$(OBJDIR)/PDAFlocal_put_state_lknetf_si.o: ./src/PDAFlocal_put_state_lknetf_si.F90 +$(OBJDIR)/PDAFlocal_put_state_lnetf.o: ./src/PDAFlocal_put_state_lnetf.F90 $(OBJDIR)/PDAF_communicate_ens.o $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_memcount.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAFlocal.o +$(OBJDIR)/PDAFlocal_put_state_lnetf_si.o: ./src/PDAFlocal_put_state_lnetf_si.F90 +$(OBJDIR)/PDAFlocal_put_state_lseik.o: ./src/PDAFlocal_put_state_lseik.F90 $(OBJDIR)/PDAF_communicate_ens.o $(OBJDIR)/PDAF_timer.o $(OBJDIR)/PDAF_timer_mpi.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAFlocal.o +$(OBJDIR)/PDAFlocal_put_state_lseik_si.o: ./src/PDAFlocal_put_state_lseik_si.F90 +$(OBJDIR)/PDAFlocal_set_increment_weights.o: ./src/PDAFlocal_set_increment_weights.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFlocal.o +$(OBJDIR)/PDAFlocal_set_indices.o: ./src/PDAFlocal_set_indices.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFlocal.o +$(OBJDIR)/PDAFlocalomi_assimilate.o: ./src/PDAFlocalomi_assimilate.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFlocalomi_assimilate_en3dvar_lestkf.o: ./src/PDAFlocalomi_assimilate_en3dvar_lestkf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFlocalomi_assimilate_en3dvar_lestkf_nondiagR.o: ./src/PDAFlocalomi_assimilate_en3dvar_lestkf_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFlocalomi_assimilate_hyb3dvar_lestkf.o: ./src/PDAFlocalomi_assimilate_hyb3dvar_lestkf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFlocalomi_assimilate_hyb3dvar_lestkf_nondiagR.o: ./src/PDAFlocalomi_assimilate_hyb3dvar_lestkf_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFlocalomi_assimilate_lknetf_nondiagR.o: ./src/PDAFlocalomi_assimilate_lknetf_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFlocalomi_assimilate_lknetf_nondiagR_si.o: ./src/PDAFlocalomi_assimilate_lknetf_nondiagR_si.F90 +$(OBJDIR)/PDAFlocalomi_assimilate_lnetf_nondiagR.o: ./src/PDAFlocalomi_assimilate_lnetf_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFlocalomi_assimilate_lnetf_nondiagR_si.o: ./src/PDAFlocalomi_assimilate_lnetf_nondiagR_si.F90 +$(OBJDIR)/PDAFlocalomi_assimilate_nondiagR.o: ./src/PDAFlocalomi_assimilate_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFlocalomi_assimilate_nondiagR_si.o: ./src/PDAFlocalomi_assimilate_nondiagR_si.F90 +$(OBJDIR)/PDAFlocalomi_assimilate_si.o: ./src/PDAFlocalomi_assimilate_si.F90 +$(OBJDIR)/PDAFlocalomi_put_state.o: ./src/PDAFlocalomi_put_state.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFlocalomi_put_state_en3dvar_lestkf.o: ./src/PDAFlocalomi_put_state_en3dvar_lestkf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFlocalomi_put_state_en3dvar_lestkf_nondiagR.o: ./src/PDAFlocalomi_put_state_en3dvar_lestkf_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFlocalomi_put_state_hyb3dvar_lestkf.o: ./src/PDAFlocalomi_put_state_hyb3dvar_lestkf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFlocalomi_put_state_hyb3dvar_lestkf_nondiagR.o: ./src/PDAFlocalomi_put_state_hyb3dvar_lestkf_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFlocalomi_put_state_lknetf_nondiagR.o: ./src/PDAFlocalomi_put_state_lknetf_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFlocalomi_put_state_lknetf_nondiagR_si.o: ./src/PDAFlocalomi_put_state_lknetf_nondiagR_si.F90 +$(OBJDIR)/PDAFlocalomi_put_state_lnetf_nondiagR.o: ./src/PDAFlocalomi_put_state_lnetf_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFlocalomi_put_state_lnetf_nondiagR_si.o: ./src/PDAFlocalomi_put_state_lnetf_nondiagR_si.F90 +$(OBJDIR)/PDAFlocalomi_put_state_nondiagR.o: ./src/PDAFlocalomi_put_state_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFlocalomi_put_state_nondiagR_si.o: ./src/PDAFlocalomi_put_state_nondiagR_si.F90 +$(OBJDIR)/PDAFlocalomi_put_state_si.o: ./src/PDAFlocalomi_put_state_si.F90 +$(OBJDIR)/PDAFomi.o: ./src/PDAFomi.F90 $(OBJDIR)/PDAFomi_obs_f.o $(OBJDIR)/PDAFomi_obs_l.o $(OBJDIR)/PDAFomi_dim_obs_l.o $(OBJDIR)/PDAFomi_obs_op.o +$(OBJDIR)/PDAFomi_assimilate_3dvar.o: ./src/PDAFomi_assimilate_3dvar.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_assimilate_3dvar_nondiagR.o: ./src/PDAFomi_assimilate_3dvar_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_assimilate_en3dvar_estkf.o: ./src/PDAFomi_assimilate_en3dvar_estkf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_assimilate_en3dvar_estkf_nondiagR.o: ./src/PDAFomi_assimilate_en3dvar_estkf_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_assimilate_en3dvar_lestkf.o: ./src/PDAFomi_assimilate_en3dvar_lestkf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_assimilate_en3dvar_lestkf_nondiagR.o: ./src/PDAFomi_assimilate_en3dvar_lestkf_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_assimilate_enkf_nondiagR.o: ./src/PDAFomi_assimilate_enkf_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_assimilate_enkf_nondiagR_si.o: ./src/PDAFomi_assimilate_enkf_nondiagR_si.F90 +$(OBJDIR)/PDAFomi_assimilate_global.o: ./src/PDAFomi_assimilate_global.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_assimilate_global_nondiagR.o: ./src/PDAFomi_assimilate_global_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_assimilate_global_nondiagR_si.o: ./src/PDAFomi_assimilate_global_nondiagR_si.F90 +$(OBJDIR)/PDAFomi_assimilate_global_si.o: ./src/PDAFomi_assimilate_global_si.F90 +$(OBJDIR)/PDAFomi_assimilate_hyb3dvar_estkf.o: ./src/PDAFomi_assimilate_hyb3dvar_estkf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_assimilate_hyb3dvar_estkf_nondiagR.o: ./src/PDAFomi_assimilate_hyb3dvar_estkf_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_assimilate_hyb3dvar_lestkf.o: ./src/PDAFomi_assimilate_hyb3dvar_lestkf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_assimilate_hyb3dvar_lestkf_nondiagR.o: ./src/PDAFomi_assimilate_hyb3dvar_lestkf_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_assimilate_lenkf.o: ./src/PDAFomi_assimilate_lenkf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_assimilate_lenkf_nondiagR.o: ./src/PDAFomi_assimilate_lenkf_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_assimilate_lenkf_nondiagR_si.o: ./src/PDAFomi_assimilate_lenkf_nondiagR_si.F90 +$(OBJDIR)/PDAFomi_assimilate_lenkf_si.o: ./src/PDAFomi_assimilate_lenkf_si.F90 +$(OBJDIR)/PDAFomi_assimilate_lknetf_nondiagR.o: ./src/PDAFomi_assimilate_lknetf_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_assimilate_lknetf_nondiagR_si.o: ./src/PDAFomi_assimilate_lknetf_nondiagR_si.F90 +$(OBJDIR)/PDAFomi_assimilate_lnetf_nondiagR.o: ./src/PDAFomi_assimilate_lnetf_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_assimilate_lnetf_nondiagR_si.o: ./src/PDAFomi_assimilate_lnetf_nondiagR_si.F90 +$(OBJDIR)/PDAFomi_assimilate_local.o: ./src/PDAFomi_assimilate_local.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_assimilate_local_nondiagR.o: ./src/PDAFomi_assimilate_local_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_assimilate_local_nondiagR_si.o: ./src/PDAFomi_assimilate_local_nondiagR_si.F90 +$(OBJDIR)/PDAFomi_assimilate_local_si.o: ./src/PDAFomi_assimilate_local_si.F90 +$(OBJDIR)/PDAFomi_assimilate_nonlin_nondiagR.o: ./src/PDAFomi_assimilate_nonlin_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_assimilate_nonlin_nondiagR_si.o: ./src/PDAFomi_assimilate_nonlin_nondiagR_si.F90 +$(OBJDIR)/PDAFomi_callback.o: ./src/PDAFomi_callback.F90 $(OBJDIR)/PDAFomi.o $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o +$(OBJDIR)/PDAFomi_dim_obs_l.o: ./src/PDAFomi_dim_obs_l.F90 $(OBJDIR)/PDAFomi_obs_f.o $(OBJDIR)/PDAFomi_obs_l.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAFomi_generate_obs.o: ./src/PDAFomi_generate_obs.F90 $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_obs_f.o: ./src/PDAFomi_obs_f.F90 $(OBJDIR)/PDAF_mod_filtermpi.o $(OBJDIR)/PDAF_mod_filter.o ./src/typedefs.h +$(OBJDIR)/PDAFomi_obs_l.o: ./src/PDAFomi_obs_l.F90 $(OBJDIR)/PDAFomi_obs_f.o $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAF_mod_filtermpi.o +$(OBJDIR)/PDAFomi_obs_op.o: ./src/PDAFomi_obs_op.F90 $(OBJDIR)/PDAFomi_obs_f.o +$(OBJDIR)/PDAFomi_put_state_3dvar.o: ./src/PDAFomi_put_state_3dvar.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_put_state_3dvar_nondiagR.o: ./src/PDAFomi_put_state_3dvar_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_put_state_en3dvar_estkf.o: ./src/PDAFomi_put_state_en3dvar_estkf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_put_state_en3dvar_estkf_nondiagR.o: ./src/PDAFomi_put_state_en3dvar_estkf_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_put_state_en3dvar_lestkf.o: ./src/PDAFomi_put_state_en3dvar_lestkf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_put_state_en3dvar_lestkf_nondiagR.o: ./src/PDAFomi_put_state_en3dvar_lestkf_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_put_state_enkf_nondiagR.o: ./src/PDAFomi_put_state_enkf_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_put_state_enkf_nondiagR_si.o: ./src/PDAFomi_put_state_enkf_nondiagR_si.F90 +$(OBJDIR)/PDAFomi_put_state_generate_obs.o: ./src/PDAFomi_put_state_generate_obs.F90 $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_put_state_global.o: ./src/PDAFomi_put_state_global.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_put_state_global_nondiagR.o: ./src/PDAFomi_put_state_global_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_put_state_global_nondiagR_si.o: ./src/PDAFomi_put_state_global_nondiagR_si.F90 +$(OBJDIR)/PDAFomi_put_state_global_si.o: ./src/PDAFomi_put_state_global_si.F90 +$(OBJDIR)/PDAFomi_put_state_hyb3dvar_estkf.o: ./src/PDAFomi_put_state_hyb3dvar_estkf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_put_state_hyb3dvar_estkf_nondiagR.o: ./src/PDAFomi_put_state_hyb3dvar_estkf_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_put_state_hyb3dvar_lestkf.o: ./src/PDAFomi_put_state_hyb3dvar_lestkf.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_put_state_hyb3dvar_lestkf_nondiagR.o: ./src/PDAFomi_put_state_hyb3dvar_lestkf_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_put_state_lenkf.o: ./src/PDAFomi_put_state_lenkf.F90 $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_put_state_lenkf_nondiagR.o: ./src/PDAFomi_put_state_lenkf_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_put_state_lenkf_nondiagR_si.o: ./src/PDAFomi_put_state_lenkf_nondiagR_si.F90 +$(OBJDIR)/PDAFomi_put_state_lenkf_si.o: ./src/PDAFomi_put_state_lenkf_si.F90 +$(OBJDIR)/PDAFomi_put_state_lknetf_nondiagR.o: ./src/PDAFomi_put_state_lknetf_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_put_state_lknetf_nondiagR_si.o: ./src/PDAFomi_put_state_lknetf_nondiagR_si.F90 +$(OBJDIR)/PDAFomi_put_state_lnetf_nondiagR.o: ./src/PDAFomi_put_state_lnetf_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_put_state_lnetf_nondiagR_si.o: ./src/PDAFomi_put_state_lnetf_nondiagR_si.F90 +$(OBJDIR)/PDAFomi_put_state_local.o: ./src/PDAFomi_put_state_local.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_put_state_local_nondiagR.o: ./src/PDAFomi_put_state_local_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_put_state_local_nondiagR_si.o: ./src/PDAFomi_put_state_local_nondiagR_si.F90 +$(OBJDIR)/PDAFomi_put_state_local_si.o: ./src/PDAFomi_put_state_local_si.F90 +$(OBJDIR)/PDAFomi_put_state_nonlin_nondiagR.o: ./src/PDAFomi_put_state_nonlin_nondiagR.F90 $(OBJDIR)/PDAF_mod_filter.o $(OBJDIR)/PDAFomi.o +$(OBJDIR)/PDAFomi_put_state_nonlin_nondiagR_si.o: ./src/PDAFomi_put_state_nonlin_nondiagR_si.F90 +$(OBJDIR)/SANGOMA_quicksort.o: ./external/SANGOMA/SANGOMA_quicksort.F90 +$(OBJDIR)/blas.o: ./external/CG+/blas.f +$(OBJDIR)/cgfam.o: ./external/CG+/cgfam.f +$(OBJDIR)/cgsearch.o: ./external/CG+/cgsearch.f +$(OBJDIR)/driver1.o: ./external/LBFGS/driver1.f +$(OBJDIR)/driver1.o: ./external/LBFGS/driver1.f90 +$(OBJDIR)/driver2.o: ./external/LBFGS/driver2.f +$(OBJDIR)/driver2.o: ./external/LBFGS/driver2.f90 +$(OBJDIR)/driver3.o: ./external/LBFGS/driver3.f +$(OBJDIR)/driver3.o: ./external/LBFGS/driver3.f90 +$(OBJDIR)/fcn.o: ./external/CG+/fcn.f +$(OBJDIR)/lbfgsb.o: ./external/LBFGS/lbfgsb.f +$(OBJDIR)/linpack.o: ./external/LBFGS/linpack.f +$(OBJDIR)/main.o: ./external/CG+/main.f +$(OBJDIR)/timer.o: ./external/CG+/timer.f +$(OBJDIR)/typedefs.h: ./src/typedefs.h diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..06ed26693 --- /dev/null +++ b/Makefile @@ -0,0 +1,583 @@ +# $Id: Makefile 1856 2017-12-06 08:36:03Z lnerger $ + +####################################################### +# Generic Makefile for to build PDAF library # +# To choose the architecture set $PDAF_ARCH # +# # +# Armin Corbin - University of Bonn # +####################################################### + +####################################################### +# definitions for highlighting outputs +bold := $(shell tput bold) +sgr0 := $(shell tput sgr0) + +####################################################### + +# Include machine-specific definitions +# For available include files see directory make.arch +# To choose a file, set PDAF_ARCH either here or by an +# environment variable. +include ./make.arch/$(PDAF_ARCH).h +$(info $(bold)use machine-specific definitions in $(PDAF_ARCH).h$(sgr0)) + +####################################################### + +OBJDIR:=build +INCDIR:=include +LIBDIR:=lib + +SRCDIR:=src +EXTDIR:=external + +####################################################### +# List of sources for PDAF library +####################################################### + +# Modules used in PDAF +SRC_MOD_PDAF = PDAF_timer.F90 \ + PDAF_memcount.F90 \ + PDAF_mod_filtermpi.F90 \ + PDAF_mod_filter.F90 + +# Module file with interface definitions +SRC_MOD_INTERFACE = PDAFlocal_interfaces.F90 \ + PDAF_interfaces_module.F90 + +# Generic routines in PDAF +SRC_PDAF_GEN = PDAF_analysis_utils.F90 \ + PDAF_init.F90 \ + PDAF_init_si.F90 \ + PDAF_init_filters.F90 \ + PDAF_alloc_filters.F90 \ + PDAF_print_info.F90 \ + PDAF_print_version.F90 \ + PDAF_communicate_ens.F90 \ + PDAF_set_comm_pdaf.F90 \ + PDAF_options_filters.F90 \ + PDAF_get_state.F90 \ + PDAF_get_state_si.F90 \ + PDAF_incremental.F90 \ + PDAF_incremental_si.F90 \ + PDAF_set_forget.F90 \ + PDAF_set_forget_local.F90 \ + PDAF_add_increment.F90 \ + PDAF_generate_rndmat.F90 \ + PDAF_local_weights.F90 \ + PDAF_local_weight.F90 \ + PDAF_force_analysis.F90 \ + PDAF_set_memberid.F90 \ + PDAF_get_memberid.F90 \ + PDAF_get_obsmemberid.F90 \ + PDAF_smoother_shift.F90 \ + PDAF_smoother.F90 \ + PDAF_smoother_local.F90 \ + PDAF_set_smootherens.F90 \ + PDAF_get_smootherens.F90 \ + PDAF_set_ens_pointer.F90 \ + PDAF_put_state_prepost.F90 \ + PDAF_put_state_prepost_si.F90 \ + PDAF_assimilate_prepost.F90 \ + PDAF_assimilate_prepost_si.F90 \ + PDAF_prepost.F90 \ + PDAF_prepost_si.F90 \ + PDAF_inflate_ens.F90 \ + PDAF_sampleens.F90 \ + PDAF_mvnormalize.F90 \ + PDAF_eofcovar.F90 \ + PDAF_diag_histogram.F90 \ + PDAF_diag_ensstats.F90 \ + PDAF_diag_effsample.F90 \ + PDAF_diag_crps.F90 \ + PDAF_gather_dim_obs_f.F90 \ + PDAF_gather_obs_f.F90 \ + PDAF_gather_obs_f2.F90 \ + PDAF_gather_obs_f_flex.F90 \ + PDAF_gather_obs_f2_flex.F90 \ + PDAF_allreduce.F90 \ + PDAF_deallocate.F90 \ + PDAF_get_assim_flag.F90 \ + PDAF_get_localfilter.F90 \ + PDAF_get_globalobs.F90 \ + PDAF_inflate_weights.F90 \ + PDAFomi_put_state_global.F90 \ + PDAFomi_put_state_global_si.F90 \ + PDAFomi_put_state_global_nondiagR.F90 \ + PDAFomi_put_state_global_nondiagR_si.F90 \ + PDAFomi_put_state_nonlin_nondiagR.F90 \ + PDAFomi_put_state_nonlin_nondiagR_si.F90 \ + PDAFomi_put_state_local.F90 \ + PDAFomi_put_state_local_si.F90 \ + PDAFomi_put_state_local_nondiagR.F90 \ + PDAFomi_put_state_local_nondiagR_si.F90 \ + PDAFomi_assimilate_global.F90 \ + PDAFomi_assimilate_global_si.F90 \ + PDAFomi_assimilate_global_nondiagR.F90 \ + PDAFomi_assimilate_global_nondiagR_si.F90 \ + PDAFomi_assimilate_nonlin_nondiagR.F90 \ + PDAFomi_assimilate_nonlin_nondiagR_si.F90 \ + PDAFomi_assimilate_local.F90 \ + PDAFomi_assimilate_local_si.F90 \ + PDAFomi_assimilate_local_nondiagR.F90 \ + PDAFomi_assimilate_local_nondiagR_si.F90 \ + PDAF_reset_forget.F90 \ + PDAF_get_ensstats.F90 \ + PDAF_set_debug_flag.F90 \ + PDAF_set_offline_mode.F90 \ + PDAFlocal.F90 \ + PDAFlocal_set_indices.F90 \ + PDAFlocal_set_increment_weights.F90 \ + PDAFlocal_clear_increment_weights.F90 \ + PDAFlocal_g2l_cb.F90 \ + PDAFlocal_l2g_cb.F90 \ + PDAFlocalomi_assimilate.F90 \ + PDAFlocalomi_assimilate_nondiagR.F90 \ + PDAFlocalomi_assimilate_nondiagR_si.F90 \ + PDAFlocalomi_assimilate_si.F90 \ + PDAFlocalomi_put_state.F90 \ + PDAFlocalomi_put_state_nondiagR.F90 \ + PDAFlocalomi_put_state_nondiagR_si.F90 \ + PDAFlocalomi_put_state_si.F90 \ + PDAF_correlation_function.F90 + +# Specific PDAF-routines for SEIK +SRC_SEIK = PDAF_seik_init.F90 \ + PDAF_seik_alloc.F90 \ + PDAF_seik_options.F90 \ + PDAF_seik_memtime.F90 \ + PDAF_put_state_seik.F90 \ + PDAF_put_state_seik_si.F90 \ + PDAF_assimilate_seik.F90 \ + PDAF_assimilate_seik_si.F90 \ + PDAF_seik_update.F90 \ + PDAF_seik_analysis.F90 \ + PDAF_seik_resample.F90 \ + PDAF_seik_analysis_newT.F90 \ + PDAF_seik_resample_newT.F90 \ + PDAF_seik_analysis_trans.F90 \ + PDAF_seik_matrixT.F90 \ + PDAF_seik_uinv.F90 \ + PDAF_seik_omega.F90 \ + PDAF_seik_TtimesA.F90 + +# Specific PDAF-routines for local SEIK +SRC_LSEIK = PDAF_lseik_init.F90 \ + PDAF_lseik_alloc.F90 \ + PDAF_lseik_options.F90 \ + PDAF_lseik_memtime.F90 \ + PDAF_put_state_lseik.F90 \ + PDAF_put_state_lseik_si.F90 \ + PDAF_assimilate_lseik.F90 \ + PDAF_assimilate_lseik_si.F90 \ + PDAF_lseik_update.F90 \ + PDAF_lseik_analysis.F90 \ + PDAF_lseik_resample.F90 \ + PDAF_lseik_analysis_trans.F90 \ + PDAFlocal_put_state_lseik.F90 \ + PDAFlocal_put_state_lseik_si.F90 \ + PDAFlocal_assimilate_lseik.F90 \ + PDAFlocal_assimilate_lseik_si.F90 + +# Specific PDAF-routines for SEEK +SRC_SEEK = PDAF_seek_init.F90 \ + PDAF_seek_alloc.F90 \ + PDAF_seek_options.F90 \ + PDAF_seek_memtime.F90 \ + PDAF_put_state_seek.F90 \ + PDAF_put_state_seek_si.F90 \ + PDAF_assimilate_seek.F90 \ + PDAF_assimilate_seek_si.F90 \ + PDAF_seek_update.F90 \ + PDAF_seek_analysis.F90 \ + PDAF_seek_rediag.F90 + +# Specific PDAF-routines for EnKF +SRC_ENKF = PDAF_enkf_init.F90 \ + PDAF_enkf_alloc.F90 \ + PDAF_enkf_options.F90 \ + PDAF_enkf_memtime.F90 \ + PDAF_put_state_enkf.F90 \ + PDAF_put_state_enkf_si.F90 \ + PDAF_assimilate_enkf.F90 \ + PDAF_assimilate_enkf_si.F90 \ + PDAF_enkf_update.F90 \ + PDAF_enkf_obs_ensemble.F90 \ + PDAF_enkf_gather_resid.F90 \ + PDAF_enkf_analysis_rlm.F90 \ + PDAF_enkf_analysis_rsm.F90 \ + PDAF_enkf_omega.F90 \ + PDAF_enkf_Tleft.F90 \ + PDAF_smoother_enkf.F90 \ + PDAFomi_put_state_enkf_nondiagR.F90 \ + PDAFomi_put_state_enkf_nondiagR_si.F90 \ + PDAFomi_assimilate_enkf_nondiagR.F90 \ + PDAFomi_assimilate_enkf_nondiagR_si.F90 + +# Specific PDAF-routines for ETKF +SRC_ETKF = PDAF_etkf_init.F90 \ + PDAF_etkf_alloc.F90 \ + PDAF_etkf_options.F90 \ + PDAF_etkf_memtime.F90 \ + PDAF_put_state_etkf.F90 \ + PDAF_put_state_etkf_si.F90 \ + PDAF_assimilate_etkf.F90 \ + PDAF_assimilate_etkf_si.F90 \ + PDAF_etkf_update.F90 \ + PDAF_etkf_analysis.F90 \ + PDAF_etkf_analysis_T.F90 \ + PDAF_etkf_analysis_fixed.F90 \ + PDAF_etkf_Tright.F90 \ + PDAF_etkf_Tleft.F90 + +# Specific PDAF-routines for LETKF +SRC_LETKF = PDAF_letkf_init.F90 \ + PDAF_letkf_alloc.F90 \ + PDAF_letkf_options.F90 \ + PDAF_letkf_memtime.F90 \ + PDAF_put_state_letkf.F90 \ + PDAF_put_state_letkf_si.F90 \ + PDAF_assimilate_letkf.F90 \ + PDAF_assimilate_letkf_si.F90 \ + PDAF_letkf_update.F90 \ + PDAF_letkf_analysis.F90 \ + PDAF_letkf_analysis_T.F90 \ + PDAF_letkf_analysis_fixed.F90 \ + PDAFlocal_put_state_letkf.F90 \ + PDAFlocal_put_state_letkf_si.F90 \ + PDAFlocal_assimilate_letkf.F90 \ + PDAFlocal_assimilate_letkf_si.F90 + +# Specific PDAF-routines for ESTKF +SRC_ESTKF = PDAF_estkf_init.F90 \ + PDAF_estkf_alloc.F90 \ + PDAF_estkf_options.F90 \ + PDAF_estkf_memtime.F90 \ + PDAF_put_state_estkf.F90 \ + PDAF_put_state_estkf_si.F90 \ + PDAF_assimilate_estkf.F90 \ + PDAF_assimilate_estkf_si.F90 \ + PDAF_estkf_update.F90 \ + PDAF_estkf_analysis.F90 \ + PDAF_estkf_analysis_fixed.F90 \ + PDAF_estkf_AOmega.F90 \ + PDAF_estkf_OmegaA.F90 + +# Specific PDAF-routines for LESTKF +SRC_LESTKF = PDAF_lestkf_init.F90 \ + PDAF_lestkf_alloc.F90 \ + PDAF_lestkf_options.F90 \ + PDAF_lestkf_memtime.F90 \ + PDAF_put_state_lestkf.F90 \ + PDAF_put_state_lestkf_si.F90 \ + PDAF_assimilate_lestkf.F90 \ + PDAF_assimilate_lestkf_si.F90 \ + PDAF_lestkf_update.F90 \ + PDAF_lestkf_analysis.F90 \ + PDAF_lestkf_analysis_fixed.F90 \ + PDAFlocal_put_state_lestkf.F90 \ + PDAFlocal_put_state_lestkf_si.F90 \ + PDAFlocal_assimilate_lestkf.F90 \ + PDAFlocal_assimilate_lestkf_si.F90 + +# Specific PDAF-routines for LEnKF +SRC_LENKF = PDAF_lenkf_init.F90 \ + PDAF_lenkf_alloc.F90 \ + PDAF_lenkf_options.F90 \ + PDAF_lenkf_memtime.F90 \ + PDAF_put_state_lenkf.F90 \ + PDAF_put_state_lenkf_si.F90 \ + PDAFomi_put_state_lenkf.F90 \ + PDAFomi_put_state_lenkf_si.F90 \ + PDAFomi_put_state_lenkf_nondiagR.F90 \ + PDAFomi_put_state_lenkf_nondiagR_si.F90 \ + PDAF_assimilate_lenkf.F90 \ + PDAF_assimilate_lenkf_si.F90 \ + PDAFomi_assimilate_lenkf.F90 \ + PDAFomi_assimilate_lenkf_si.F90 \ + PDAFomi_assimilate_lenkf_nondiagR.F90 \ + PDAFomi_assimilate_lenkf_nondiagR_si.F90 \ + PDAF_lenkf_update.F90 \ + PDAF_lenkf_analysis_rsm.F90 +# Additional objects used by LEnKF but already specified for EnKF +# PDAF_enkf_gather_resid.F90 +# PDAF_enkf_obs_ensemble.F90 +# PDAF_enkf_omega.F90 +# PDAF_enkf_Tleft.F90 + +# Specific PDAF-routines for NETF +SRC_NETF = PDAF_netf_init.F90 \ + PDAF_netf_alloc.F90 \ + PDAF_netf_options.F90 \ + PDAF_netf_memtime.F90 \ + PDAF_put_state_netf.F90 \ + PDAF_put_state_netf_si.F90 \ + PDAF_assimilate_netf.F90 \ + PDAF_assimilate_netf_si.F90 \ + PDAF_netf_update.F90 \ + PDAF_netf_smootherT.F90 \ + PDAF_netf_analysis.F90 \ + PDAF_smoother_netf.F90 + +# Specific PDAF-routines for LNETF +SRC_LNETF = PDAF_lnetf_init.F90 \ + PDAF_lnetf_alloc.F90 \ + PDAF_lnetf_options.F90 \ + PDAF_lnetf_memtime.F90 \ + PDAF_put_state_lnetf.F90 \ + PDAF_put_state_lnetf_si.F90 \ + PDAF_assimilate_lnetf.F90 \ + PDAF_assimilate_lnetf_si.F90 \ + PDAF_lnetf_update.F90 \ + PDAF_lnetf_analysis.F90 \ + PDAF_lnetf_smootherT.F90 \ + PDAF_smoother_lnetf.F90 \ + PDAFomi_put_state_lnetf_nondiagR.F90 \ + PDAFomi_put_state_lnetf_nondiagR_si.F90 \ + PDAFomi_assimilate_lnetf_nondiagR.F90 \ + PDAFomi_assimilate_lnetf_nondiagR_si.F90 \ + PDAFlocal_put_state_lnetf.F90 \ + PDAFlocal_put_state_lnetf_si.F90 \ + PDAFlocal_assimilate_lnetf.F90 \ + PDAFlocal_assimilate_lnetf_si.F90 \ + PDAFlocalomi_assimilate_lnetf_nondiagR.F90 \ + PDAFlocalomi_assimilate_lnetf_nondiagR_si.F90 \ + PDAFlocalomi_put_state_lnetf_nondiagR.F90 \ + PDAFlocalomi_put_state_lnetf_nondiagR_si.F90 + +# Specific PDAF-routines for PF +SRC_PF = PDAF_pf_init.F90 \ + PDAF_pf_alloc.F90 \ + PDAF_pf_options.F90 \ + PDAF_pf_memtime.F90 \ + PDAF_put_state_pf.F90 \ + PDAF_put_state_pf_si.F90 \ + PDAF_assimilate_pf.F90 \ + PDAF_assimilate_pf_si.F90 \ + PDAF_pf_update.F90 \ + PDAF_pf_analysis.F90 \ + PDAF_pf_resampling.F90 \ + PDAF_pf_add_noise.F90 + +# Specific PDAF-routines for LKNETF +SRC_LKNETF = PDAF_lknetf_init.F90 \ + PDAF_lknetf_alloc.F90 \ + PDAF_lknetf_options.F90 \ + PDAF_lknetf_memtime.F90 \ + PDAF_put_state_lknetf.F90 \ + PDAF_put_state_lknetf_si.F90 \ + PDAF_assimilate_lknetf.F90 \ + PDAF_assimilate_lknetf_si.F90 \ + PDAF_lknetf_update.F90 \ + PDAF_lknetf_analysis_T.F90 \ + PDAF_lknetf_step_update.F90 \ + PDAF_lknetf_ana_lnetf.F90 \ + PDAF_lknetf_ana_letkfT.F90 \ + PDAF_lknetf_compute_gamma.F90 \ + PDAF_lknetf_set_gamma.F90 \ + PDAF_lknetf_alpha_neff.F90 \ + PDAF_lknetf_reset_gamma.F90 \ + PDAFomi_put_state_lknetf_nondiagR.F90 \ + PDAFomi_put_state_lknetf_nondiagR_si.F90 \ + PDAFomi_assimilate_lknetf_nondiagR.F90 \ + PDAFomi_assimilate_lknetf_nondiagR_si.F90 \ + PDAFlocal_put_state_lknetf.F90 \ + PDAFlocal_put_state_lknetf_si.F90 \ + PDAFlocal_assimilate_lknetf.F90 \ + PDAFlocal_assimilate_lknetf_si.F90 \ + PDAFlocalomi_assimilate_lknetf_nondiagR.F90 \ + PDAFlocalomi_assimilate_lknetf_nondiagR_si.F90 \ + PDAFlocalomi_put_state_lknetf_nondiagR.F90 \ + PDAFlocalomi_put_state_lknetf_nondiagR_si.F90 + +# Specific PDAF-routines for generating observations +SRC_OBSGEN = PDAF_genobs_init.F90 \ + PDAF_genobs_alloc.F90 \ + PDAF_genobs_options.F90 \ + PDAF_put_state_generate_obs.F90 \ + PDAF_put_state_generate_obs_si.F90 \ + PDAFomi_put_state_generate_obs.F90 \ + PDAF_generate_obs.F90 \ + PDAF_generate_obs_si.F90 \ + PDAFomi_generate_obs.F90 \ + PDAF_gen_obs.F90 + +# Specific PDAF-routines for 3DVAR initialization part +SRC_3DVAR_INI = PDAF_3dvar_init.F90 \ + PDAF_3dvar_alloc.F90 \ + PDAF_3dvar_options.F90 \ + PDAF_3dvar_memtime.F90 + +# Specific PDAF-routines for 3DVAR +SRC_3DVAR = PDAF_put_state_3dvar.F90 \ + PDAF_assimilate_3dvar.F90 \ + PDAF_3dvar_update.F90 \ + PDAF_3dvar_analysis_cvt.F90 \ + PDAF_3dvar_optim_lbfgs.F90 \ + PDAF_3dvar_optim_cgplus.F90 \ + PDAF_3dvar_costf_cvt.F90 \ + PDAF_3dvar_costf_cg_cvt.F90 \ + PDAF_3dvar_optim_cg.F90 \ + PDAF_put_state_en3dvar_lestkf.F90 \ + PDAF_assimilate_en3dvar_lestkf.F90 \ + PDAF_en3dvar_update_lestkf.F90 \ + PDAF_put_state_en3dvar_estkf.F90 \ + PDAF_assimilate_en3dvar_estkf.F90 \ + PDAF_en3dvar_update_estkf.F90 \ + PDAF_en3dvar_analysis_cvt.F90 \ + PDAF_en3dvar_optim_lbfgs.F90 \ + PDAF_en3dvar_optim_cgplus.F90 \ + PDAF_en3dvar_optim_cg.F90 \ + PDAF_en3dvar_costf_cvt.F90 \ + PDAF_en3dvar_costf_cg_cvt.F90 \ + PDAF_put_state_hyb3dvar_lestkf.F90 \ + PDAF_assimilate_hyb3dvar_lestkf.F90 \ + PDAF_hyb3dvar_update_lestkf.F90 \ + PDAF_hyb3dvar_analysis_cvt.F90\ + PDAF_put_state_hyb3dvar_estkf.F90 \ + PDAF_assimilate_hyb3dvar_estkf.F90 \ + PDAF_hyb3dvar_update_estkf.F90 \ + PDAF_hyb3dvar_optim_lbfgs.F90 \ + PDAF_hyb3dvar_optim_cgplus.F90 \ + PDAF_hyb3dvar_optim_cg.F90 \ + PDAF_hyb3dvar_costf_cvt.F90 \ + PDAF_hyb3dvar_costf_cg_cvt.F90 \ + PDAFlocal_put_state_en3dvar_lestkf.F90 \ + PDAFlocal_put_state_hyb3dvar_lestkf.F90 \ + PDAFlocal_assimilate_en3dvar_lestkf.F90 \ + PDAFlocal_assimilate_hyb3dvar_lestkf.F90 \ + PDAFomi_assimilate_3dvar.F90 \ + PDAFomi_assimilate_en3dvar_estkf.F90 \ + PDAFomi_assimilate_en3dvar_lestkf.F90 \ + PDAFomi_assimilate_hyb3dvar_estkf.F90 \ + PDAFomi_assimilate_hyb3dvar_lestkf.F90 \ + PDAFomi_assimilate_3dvar_nondiagR.F90 \ + PDAFomi_assimilate_en3dvar_estkf_nondiagR.F90 \ + PDAFomi_assimilate_en3dvar_lestkf_nondiagR.F90 \ + PDAFomi_assimilate_hyb3dvar_estkf_nondiagR.F90 \ + PDAFomi_assimilate_hyb3dvar_lestkf_nondiagR.F90 \ + PDAFlocalomi_assimilate_en3dvar_lestkf.F90 \ + PDAFlocalomi_assimilate_en3dvar_lestkf_nondiagR.F90 \ + PDAFlocalomi_assimilate_hyb3dvar_lestkf.F90 \ + PDAFlocalomi_assimilate_hyb3dvar_lestkf_nondiagR.F90 \ + PDAFomi_put_state_3dvar.F90 \ + PDAFomi_put_state_en3dvar_estkf.F90 \ + PDAFomi_put_state_en3dvar_lestkf.F90 \ + PDAFomi_put_state_hyb3dvar_estkf.F90 \ + PDAFomi_put_state_hyb3dvar_lestkf.F90 \ + PDAFomi_put_state_3dvar_nondiagR.F90 \ + PDAFomi_put_state_en3dvar_estkf_nondiagR.F90 \ + PDAFomi_put_state_en3dvar_lestkf_nondiagR.F90 \ + PDAFomi_put_state_hyb3dvar_estkf_nondiagR.F90 \ + PDAFomi_put_state_hyb3dvar_lestkf_nondiagR.F90 \ + PDAFlocalomi_put_state_en3dvar_lestkf.F90 \ + PDAFlocalomi_put_state_en3dvar_lestkf_nondiagR.F90 \ + PDAFlocalomi_put_state_hyb3dvar_lestkf.F90 \ + PDAFlocalomi_put_state_hyb3dvar_lestkf_nondiagR.F90 +# Additional file for 3DVar already specified in SRC_3DVAR_ini +# PDAF_3dvar_memtime.F90 + +# Routines for PDAF-OMI +SRC_PDAFOMI = PDAFomi_obs_f.F90 \ + PDAFomi_obs_l.F90 \ + PDAFomi_dim_obs_l.F90 \ + PDAFomi_obs_op.F90 \ + PDAFomi.F90 \ + PDAFomi_callback.F90 + +# collect all PDAF sources +SRC_PDAF = $(SRC_MOD_INTERFACE) $(SRC_PDAFOMI) $(SRC_PDAF_GEN) \ + $(SRC_SEIK) $(SRC_LSEIK) $(SRC_SEEK) \ + $(SRC_ENKF) $(SRC_ETKF) $(SRC_LETKF) \ + $(SRC_ESTKF) $(SRC_LESTKF) $(SRC_LENKF) $(SRC_NETF) $(SRC_LNETF) \ + $(SRC_LKNETF) $(SRC_PF) $(SRC_OBSGEN) $(SRC_3DVAR_INI) \ + $(SRC_MOD_PDAF) + +# external sources +SRC_SANGOMA = $(EXTDIR)/SANGOMA/SANGOMA_quicksort.F90 + +####################################################### +# object files +####################################################### +OBJ_PDAF := $(SRC_PDAF:%.F90=$(OBJDIR)/%.o) + +OBJ_PDAF_VAR = $(SRC_3DVAR:%.F90=$(OBJDIR)/%.o) + +OBJ_SANGOMA = $(OBJDIR)/SANGOMA_quicksort.o + +# External optimizer libraries implicitly build by make +OBJ_OPTIM = $(EXTDIR)/CG+_mpi/cgfam.o $(EXTDIR)/CG+_mpi/cgsearch.o \ + $(EXTDIR)/CG+/cgfam.o $(EXTDIR)/CG+/cgsearch.o \ + $(EXTDIR)/LBFGS/lbfgsb.o $(EXTDIR)/LBFGS/linpack.o \ + $(EXTDIR)/LBFGS/timer.o + +####################################################### +# compiler instructions + +COMPILE.f90 = $(FC) $(OPT) $(MPI_INC) $(CPP_DEFS) -c -o $@ $(MODULEOPT) $(INCDIR) + +####################################################### +.PHONY: all +all: directories libpdaf libpdafvar + +.PHONY: libpdaf +libpdaf: $(LIBDIR)/libpdaf-d.a + +.PHONY: libpdafvar +libpdafvar: $(LIBDIR)/libpdaf-var.a +####################################################### + +$(LIBDIR)/libpdaf-d.a: $(OBJ_PDAF) $(OBJ_SANGOMA) + $(info $(bold)Generate Filter library$(sgr0)) + $(AR) rs $(AR_SPEC) $(LIBDIR)/libpdaf-d.a $(OBJ_PDAF) $(OBJ_SANGOMA) + +$(LIBDIR)/libpdaf-var.a: $(OBJ_PDAF) $(OBJ_PDAF_VAR) $(OBJ_OPTIM) + $(info $(bold)Generate Var Filter library$(sgr0)) + $(AR) rs $(AR_SPEC) $(LIBDIR)/libpdaf-var.a $(OBJ_PDAF) $(OBJ_PDAF_VAR) $(OBJ_OPTIM) + +# use pattern rule to create rules for all object files +$(OBJDIR)/%.o: $(SRCDIR)/%.F90 + $(info $(bold)compile $<$(sgr0)) + $(COMPILE.f90) $< + +# explicite rule for sangoma +$(OBJ_SANGOMA) : $(SRC_SANGOMA) + $(info $(bold)compile external dependency $<$(sgr0)) + $(COMPILE.f90) $< + +####################################################### +MISSINGDIRS:= $(INCDIR) $(OBJDIR) $(LIBDIR) +.PHONY: directories +directories: $(MISSINGDIRS) + +$(MISSINGDIRS): + mkdir -p $@ + +####################################################### +.PHONY: clean +clean : + $(info $(bold)clean PDAF$(sgr0)) + rm -rf $(OBJDIR)/*.o + rm -rf $(INCDIR)/*.mod + rm -rf $(LIBDIR)/libpdaf-d.a + rm -rf $(LIBDIR)/libpdaf-var.a + rm -rf $(EXTDIR)/CG+/*.o + rm -rf $(EXTDIR)/CG+_mpi/*.o + rm -rf $(EXTDIR)/LBFGS/*.o + +.PHONY: veryclean +veryclean: clean + rm -r $(OBJDIR) + rm -r $(INCDIR) + rm -r $(LIBDIR) +####################################################### +.PHONY: listarch +listarch: + @echo Available architecture-specific input files for PDAF_ARCH + @echo --------------------------------------------------------- + @ls -1 ../make.arch | cut -d"." -f1 + +####################################################### +# include file containing dependencies for parallel +# execution of make +# created with ./external/mkdepends/mkdepends ./src ./external/* '$(OBJDIR)' +include Depends diff --git a/README.md b/README.md index bf9145238..d7a30afb7 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ PDAF provides The PDAF release provides also - Tutorial codes demontrating the implementation -- Code templates for assist in the implementation +- Code templates to assist in the implementation - Toy models fully implemented with PDAF for the study of data assimilation methods. - Model bindings for using PDAF with different models diff --git a/external/SANGOMA/SANGOMA_quicksort.F90 b/external/SANGOMA/SANGOMA_quicksort.F90 new file mode 100644 index 000000000..885688329 --- /dev/null +++ b/external/SANGOMA/SANGOMA_quicksort.F90 @@ -0,0 +1,273 @@ +module SANGOMA_quicksort + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!! Time-stamp: <2014-11-19 17:57:23 vetra-carvalho> +!!! +!!! Subsection of subroutines needed for the equivalent weights +!!! particle filter code supplied for SANGOMA project by +!!! Sanita Vetra-Carvalho. +!!! +!!! This code was taken from http://rosettacode.org/wiki/Quicksort#Fortran +!!! and is distributed under GNU Free Documentation License 1.2. +!!! see http://www.gnu.org/licenses/fdl-1.2.html and was modified to also return +!!! sorted index of the original array a. +!!! +!!! Collection of subroutines to sort and return a one-dimensional array +!!! as well as corresponding sorted index of the array a. +!!! Copyright (C) 2014 S. Vetra-Carvalho +!!! +!!! This program is free software: you can redistribute it and/or modify +!!! it under the terms of the GNU General Public License as published by +!!! the Free Software Foundation, either version 3 of the License, or +!!! (at your option) any later version. +!!! +!!! This program is distributed in the hope that it will be useful, +!!! but WITHOUT ANY WARRANTY; without even the implied warranty of +!!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +!!! GNU General Public License for more details. +!!! +!!! You should have received a copy of the GNU General Public License +!!! along with this program. If not, see . +!!! +!!! Email: s.vetra-carvalho @ reading.ac.uk +!!! Mail: School of Mathematical and Physical Sciences, +!!! University of Reading, +!!! Reading, UK +!!! RG6 6BB +!!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +contains + +!> subroutine to sort using the quicksort algorithm +!! @param[in,out] a, an array of doubles to be sorted +!! @param[in] na, dimension of the array a + + recursive subroutine quicksort_d(a,na) + + implicit none + + ! DUMMY ARGUMENTS + integer, intent(in) :: na ! nr or items to sort + real, dimension(nA), intent(inout) :: a ! vector to be sorted + + ! LOCAL VARIABLES + integer :: left, right, mid + real :: pivot, temp + integer :: marker + + if (nA > 1) then + ! insertion sort limit of 47 seems best for sorting 10 million + ! integers on Intel i7-980X CPU. Derived data types that use + ! more memory are optimized with smaller values - around 20 for a 16 + ! -byte type. + if (nA > 47) then + ! Do quicksort for large groups + ! Get median of 1st, mid, & last points for pivot (helps reduce + ! long execution time on some data sets, such as already + ! sorted data, over simple 1st point pivot) + mid = (nA+1)/2 + if (a(mid) >= a(1)) then + if (a(mid) <= a(nA)) then + pivot = a(mid) + else if (a(nA) > a(1)) then + pivot = a(nA) + else + pivot = a(1) + end if + else if (a(1) <= a(nA)) then + pivot = a(1) + else if (a(nA) > a(mid)) then + pivot = a(nA) + else + pivot = a(mid) + end if + + left = 0 + right = nA + 1 + + do while (left < right) + right = right - 1 + do while (A(right) > pivot) + right = right - 1 + end do + left = left + 1 + do while (A(left) < pivot) + left = left + 1 + end do + if (left < right) then + temp = A(left) + A(left) = A(right) + A(right) = temp + end if + end do + + if (left == right) then + marker = left + 1 + else + marker = left + end if + + call quicksort_d(A(:marker-1),marker-1) + call quicksort_d(A(marker:),nA-marker+1) + + else + call InsertionSort_d(A,nA) ! Insertion sort for small groups is faster than Quicksort + end if + end if + + end subroutine quicksort_d + + +!> subroutine to sort using the insertionsort algorithm and return indecies +!! @param[in,out] a, an array of doubles to be sorted +!! @param[in] na, dimension of the array a + subroutine InsertionSort_d(a,na) + + ! DUMMY ARGUMENTS + integer, intent(in) :: na !< nr or items to sort + real, dimension(nA), intent(inout) :: a !< vector to be sorted + + ! LOCAL VARIABLES + real :: temp + integer :: i, j + + do i = 2, nA + j = i - 1 + temp = A(i) + do + if (j == 0) exit + if (a(j) <= temp) exit + A(j+1) = A(j) + j = j - 1 + end do + a(j+1) = temp + end do + + end subroutine InsertionSort_d + +!--------------------------------------------------------------------------- +!> Quicksort for real and index array vectors +!! + recursive subroutine quicksort_idx_d(a,idx_a,na) + + implicit none + + ! DUMMY ARGUMENTS + integer, intent(in) :: na !< nr or items to sort + real, dimension(nA), intent(inout) :: a !< vector to be sorted + integer, dimension(nA), intent(inout) :: idx_a !< sorted indecies of a + + ! LOCAL VARIABLES + integer :: left, right, mid + real :: pivot, temp + integer :: marker, idx_temp + integer :: i ! counter + + + ! If this is the original call of the quicksort_d function + ! assign indecies to the array that we are sorting + if (sum(idx_a) .eq. 0) then + do i = 1,na + idx_a(i) = 1 + end do + end if + + if (nA > 1) then + ! insertion sort limit of 47 seems best for sorting 10 million + ! integers on Intel i7-980X CPU. Derived data types that use + ! more memory are optimized with smaller values - around 20 for a 16 + ! -byte type. + if (nA > 47) then + ! Do quicksort for large groups + ! Get median of 1st, mid, & last points for pivot (helps reduce + ! long execution time on some data sets, such as already + ! sorted data, over simple 1st point pivot) + mid = (nA+1)/2 + if (a(mid) >= a(1)) then + if (a(mid) <= a(nA)) then + pivot = a(mid) + else if (a(nA) > a(1)) then + pivot = a(nA) + else + pivot = a(1) + end if + else if (a(1) <= a(nA)) then + pivot = a(1) + else if (a(nA) > a(mid)) then + pivot = a(nA) + else + pivot = a(mid) + end if + + left = 0 + right = nA + 1 + + do while (left < right) + right = right - 1 + do while (A(right) > pivot) + right = right - 1 + end do + left = left + 1 + do while (A(left) < pivot) + left = left + 1 + end do + if (left < right) then + temp = A(left) + idx_temp = idx_a(left) + A(left) = A(right) + idx_a(left) = idx_a(right) + A(right) = temp + idx_a(right) = idx_temp + end if + end do + + if (left == right) then + marker = left + 1 + else + marker = left + end if + + call quicksort_idx_d(A(:marker-1),idx_A(:marker-1),marker-1) + call quicksort_idx_d(A(marker:),idx_A(marker:),nA-marker+1) + + else + call InsertionSort_idx_d(A,idx_a,nA) ! Insertion sort for small groups is faster than Quicksort + end if + end if + + end subroutine quicksort_idx_d + + +!> subroutine to sort using the insertionsort algorithm and return indecies +!! @param[in,out] a, an array of doubles to be sorted +!! @param[in,out] idx_a, an array of integers of sorted indecies +!! @param[in] na, dimension of the array a + subroutine InsertionSort_idx_d(a,idx_a,na) + + ! DUMMY ARGUMENTS + integer, intent(in) :: na !< nr or items to sort + real, dimension(nA), intent(inout) :: a !< vector to be sorted + integer, dimension(nA), intent(inout) :: idx_a !< sorted indecies of a + + ! LOCAL VARIABLES + real :: temp + integer :: i, j + + do i = 2, nA + j = i - 1 + temp = A(i) + do + if (j == 0) exit + if (a(j) <= temp) exit + A(j+1) = A(j) + idx_a(j+1) = idx_a(j) + j = j - 1 + end do + a(j+1) = temp + idx_a(j+1) = i + end do + + end subroutine InsertionSort_idx_d + +end module SANGOMA_quicksort diff --git a/external/mkdepends/mkdepends b/external/mkdepends/mkdepends new file mode 100755 index 000000000..69f2e8442 --- /dev/null +++ b/external/mkdepends/mkdepends @@ -0,0 +1,272 @@ +#!/usr/bin/perl +use Cwd; +use File::Basename; +# +# This script was found in the NCAR HAO TIE-GCM 2.0 +# +# Make dependencies for gmake. This script outputs the file "Depends", +# which is included in the Makefile. (sub mksrcfiles also outputs local +# file Srcfiles, which is also referred to by Makefile) +# +# AC 06.11.2019: regex is case-insensitive for search of 'use' keyword. +# AC 26.10.2021: last argument is build path +# AC 05.06.2024: ignore case in findmember +# +$date = `date`; chop($date); +$cwd = cwd(); +($prog = $0) =~ s!(.*)/!!; +print STDERR "\n"; +# +my $argc = @ARGV; +for (my $i = 0; $i < $argc-1; $i++) { + $dir = @ARGV[$i]; + push(@file_paths,$dir); +} +$build =@ARGV[$argc-1]; +print "build dir is: $build\n"; +# while (@ARGV) { +# +# $dir = shift(); +# push(@file_paths,$dir); +# } +print "$prog: file_paths = "; foreach $dir (@file_paths) { print "$dir"; } +print "\n"; +# +# Make list of source files (returns src list and makes file ./Srcfiles): +# + %src = &mksrcfiles(@file_paths); +# +# Output file: +# +$outfile_depends = "Depends"; +open(DEPENDS, "> $outfile_depends") or + die "$prog: Can't open output file $outfile_depends\n"; +# +# Get list of all modules declared: +# +%modules = (); +foreach $file (sort keys %src) { + $srcfile = "$src{$file}/$file"; # full path + open(SRCFILE,"< $srcfile") || die "Error opening source file $srcfile\n"; + while () { + if (/^\s*(?i)module (.*)/) { + $modules{$srcfile} .= $1 . ' '; + } + } +# print "modules in srcfile $srcfile:\n $modules{$srcfile}\n"; +} +# +# Build dependencies for each source file: +# +foreach $file (sort keys %src) { + $srcdir = $src{$file}; # directory + $srcfile = "$srcdir/$file"; # full path + $object = "$build/$file"; $object =~ s/\.[fF]$/\.o/; + $object =~ s/\.f90$/\.o/; # for freeform *.f90 source files + $object =~ s/\.F90$/\.o/; # for freeform *.F90 source files that need preprocessor + + undef(@module_deps); # module dependencies for each source file + undef(@include_deps); # include dependencies for each source file + undef(@file_deps); # file dependencies for each source file +# +# Read source file, building list of modules used and files included: +# + open(SRCFILE,"< $srcfile") || die "Error opening source file $srcfile\n"; + while () { +# +# Build list of modules used by this source: + if (/^\s*(?i)use (\w*)/) { + $module = $1; + if ($module =~ /(\w*[^,])[,]/) { $module = $1; } + if (&findmember($module,@module_deps) < 0) { + push(@module_deps,$module); + } + } # use statement +# +# Check for include statements: +# +# Fortran style include statement: + if ( /^\s+include\s+[<"'](.*)[>"']/ ) { + $hdrfile = $1; + $hdrfile = "$src{$hdrfile}/$hdrfile"; + if (&findmember($hdrfile,@include_deps) < 0) { + push(@include_deps,$hdrfile); + } + } +# +# cpp style include statement: + if ( /^#include\s+[<"'](.*)[>"']/ ) { + $hdrfile = $1; + $hdrfile = "$src{$hdrfile}/$hdrfile"; + if (&findmember($hdrfile,@include_deps) < 0) { + push(@include_deps,$hdrfile); + } + } + } # while () + +# print "\nmodule_deps for $srcfile:\n"; +# print " @module_deps\n"; +# +# Find file dependencies: +# + push(@file_deps,$srcfile); # first file dep is its own source file +# +# Add object files containing modules used by the source file: +# + if (@module_deps) { + foreach $module (@module_deps) { + undef($filedep); + foreach $filename (sort keys %src) { + $filepath = "$src{$filename}/$filename"; + @modules_in_src = split(' ',$modules{$filepath}); + if (&findmember($module,@modules_in_src) >= 0) { + $filedep = "$build/$filename"; + $filedep =~ s/\.[fF]$/\.o/; + $filedep =~ s/\.F90$/\.o/; # for freeform *.F90 files + $filedep =~ s/\.f90$/\.o/; # for freeform *.f90 files + push(@file_deps,$filedep); + } + } + if (! $filedep) { +# print STDERR "WARNING: could not find module $module (used by source file $filepath)\n"; + } + } + } # if @module_deps +# print "file_deps for srcfile $srcfile:\n @file_deps\n"; +# +# Add included header files to list of file dependencies: +# + if (@include_deps) { + foreach $hdrfile (@include_deps) { + if (-e $hdrfile) { + push(@file_deps,$hdrfile); + } else { +# print STDERR "WARNING: could not find header file $hdrfile (included by source file $srcfile)\n"; + } + } + } + + close($srcfile); +# +# Remove any "self" (redundant) dependencies, +# (i.e., file.o not a dependency of file.o). +# This avoids circular dependency warnings from the compiler. +# + undef(@deps_final); # final file dependencies for each source file + foreach $dep (@file_deps) { + if ($dep ne $object and basename($dep) ne $object) { + push(@deps_final,$dep); + } + } + +# print "----------------------------------------------------------------\n"; +# print "File = $file\n"; +# print "Path = $srcfile\n"; +# print "Object = $object\n"; +# print "\n"; +# print "Include dependencies = @include_deps\n"; +# print "Module dependencies = @module_deps\n"; +# print "File dependencies = @file_deps\n"; + +# +# Write Depends file: + print DEPENDS "$object: @deps_final\n"; +# print "$object: @deps_final\n"; + +} # each source file + +# print STDERR "$prog: Wrote dependency file $outfile_depends\n"; +# +# Write Srcfiles file: +# foreach $file (sort keys %src) { print SRCFILES "$file\n"; } +# print "$prog: Wrote source list file $outfile_srcs\n"; +# print STDERR "\n"; + +exit; + +#------------------------------------------------------------------------- +sub findmember { +# +# Given a string $member, and a list @list, search for $member in @list +# and if found return index of $member in @list, otherwise return -1: +# +# (Note this routine also in $TGCMROOT/bin/util.pl) +# + local ($member,@list) = @_; + local ($offset); + $offset = 0; + foreach $ele (@list) { + if (lc($ele) eq lc($member)) { + return $offset + } + $offset++; + } + $offset = -1; + return $offset; +} +#------------------------------------------------------------------------- +sub usage { +die < $outfile_srcs") or + die "$prog: Can't open output file $outfile_srcs\n"; +# +# Make list of source files (*.F, *.c, *.F90): +# (header files are not included in SRCFILES) +# + %src = (); + foreach $dir (@paths) { + $nfiles = 0; + @filenames = (glob("$dir/*.[Ffc]"), glob("$dir/*.F90"), glob("$dir/*.f90")); + foreach $filename (@filenames) { + $file = basename($filename); + if ($file =~ /^,/) { + print "$prog: Not using comma-prefixed source file $filename\n"; + } else { + $filename =~ s!.*/!!; # remove part before last slash + if (! $src{$filename}) { + $src{$filename} = "$dir"; # use first occurrence + $nfiles = $nfiles+1; + } + } + } + print STDERR "$prog: Found $nfiles source files in $dir\n"; + } + print STDERR "\n"; + foreach $file (sort keys %src) { print SRCFILES "$file\n"; } + close SRCFILES; +# +# Add list of header files (*.h) to %src for the rest of mkdepends: +# + foreach $dir (@paths) { + $nhdrs = 0; + @hdrnames = glob("$dir/*.h"); + foreach $hdrname (@hdrnames) { + $file = basename($hdrname); + if ($file =~ /^,/) { + print "$prog: Not using comma-prefixed header file $hdrname\n"; + } else { + $hdrname =~ s!.*/!!; # remove part before last slash + if (! $src{$hdrname}) { + $src{$hdrname} = "$dir"; # use first occurrence + $nhdrs = $nhdrs+1; + } + } + } + print STDERR "$prog: Found $nhdrs header files in $dir\n"; + } # foreach $dir (@paths) + print STDERR "\n"; + return %src; +} diff --git a/include/.empty b/include/.empty deleted file mode 100644 index e69de29bb..000000000 diff --git a/lib/.empty b/lib/.empty deleted file mode 100644 index e69de29bb..000000000 diff --git a/make.arch/Albedo_mpiifort_impi.h b/make.arch/Albedo_mpiifort_impi.h index 4832c82a6..a1d508acb 100644 --- a/make.arch/Albedo_mpiifort_impi.h +++ b/make.arch/Albedo_mpiifort_impi.h @@ -41,6 +41,9 @@ AR_SPEC = # Specifications for ranlib RAN_SPEC = +# Specification for directory holding modules (-module for Intel, -J for GNU) +MODULEOPT = -module + # Include path for MPI header file MPI_INC = diff --git a/make.arch/HLRN4_mpifort_ompi.h b/make.arch/HLRN4_mpifort_ompi.h index affbfb3d5..6ce21f865 100644 --- a/make.arch/HLRN4_mpifort_ompi.h +++ b/make.arch/HLRN4_mpifort_ompi.h @@ -3,7 +3,7 @@ # for building PDAF. # # # # Variant for HLRN-IV # -# (ifort with Intel MPI using wrapper mpiifort) # +# (ifort with Intel MPI using wrapper mpifort) # # # # In the case of compilation without MPI, a dummy # # implementation of MPI, like provided in the # @@ -47,6 +47,9 @@ AR_SPEC = # Specifications for ranlib RAN_SPEC = +# Specification for directory holding modules (-module for Intel, -J for GNU) +MODULEOPT = -module + # Include path for MPI header file MPI_INC = diff --git a/make.arch/HLRN4_mpiifort_impi.h b/make.arch/HLRN4_mpiifort_impi.h index 5d9410647..f80c69b69 100644 --- a/make.arch/HLRN4_mpiifort_impi.h +++ b/make.arch/HLRN4_mpiifort_impi.h @@ -47,6 +47,9 @@ AR_SPEC = # Specifications for ranlib RAN_SPEC = +# Specification for directory holding modules (-module for Intel, -J for GNU) +MODULEOPT = -module + # Include path for MPI header file MPI_INC = diff --git a/make.arch/Levante_mpiifort_impi.h b/make.arch/Levante_mpiifort_impi.h index 305c789e2..e31010fbd 100644 --- a/make.arch/Levante_mpiifort_impi.h +++ b/make.arch/Levante_mpiifort_impi.h @@ -37,14 +37,6 @@ LINK_LIBS =-L/sw/spack-levante/intel-oneapi-mkl-2022.0.1-ttdktf/mkl/2022.0.1/lib -Wl,-rpath,/sw/spack-levante/intel-oneapi-mkl-2022.0.1-ttdktf/mkl/2022.0.1/lib/intel64 \ -Wl,-rpath,/sw/spack-levante/netcdf-fortran-4.5.3-l2ulgp/lib -#LINK_LIBS =-L/sw/spack-levante/intel-oneapi-mkl-2022.0.1-ttdktf/mkl/2022.0.1/lib/intel64 \ -# -Wl,-rpath,/sw/spack-levante/intel-oneapi-mkl-2022.0.1-ttdktf/mkl/2022.0.1/lib/intel64 \ -# -Wl,-rpath,/sw/spack-levante/netcdf-fortran-4.5.3-k6xq5g/lib - -#LINK_LIBS = -L/sw/spack-levante/intel-oneapi-mkl-2022.0.1-ttdktf/mkl/2022.0.1/lib/intel64 - -#LINK_LIBS = -Wl,-rpath,/sw/spack-levante/intel-oneapi-mkl-2022.0.1-ttdktf/mkl/2022.0.1/lib/intel64 \ -# -Wl,-rpath,/sw/spack-levante/netcdf-fortran-4.5.3-k6xq5g/lib # Specifications for the archiver AR_SPEC = @@ -52,8 +44,12 @@ AR_SPEC = # Specifications for ranlib RAN_SPEC = +# Specification for directory holding modules (-module for Intel, -J for GNU) +MODULEOPT = -module + # Include path for MPI header file MPI_INC = # dummy MPI for PDAF versions < 2 + # Object for nullMPI - if compiled without MPI library OBJ_MPI = # needed when running without MPI for PDAF versions < 2 diff --git a/make.arch/cmake.h b/make.arch/cmake.h index 2d455a6bb..c9ead4575 100644 --- a/make.arch/cmake.h +++ b/make.arch/cmake.h @@ -52,7 +52,7 @@ AR_SPEC = RAN_SPEC = # Specification for directory holding modules (-module for Intel, -J for GNU) -MODULEOPT = -module +MODULEOPT = ${TSMPPDAFMODULEOPT} # Include path for MPI header file MPI_INC = ${TSMPPDAFMPI_INC} diff --git a/make.arch/cray-xd1_pg_mpich.h b/make.arch/cray-xd1_pg_mpich.h deleted file mode 100644 index 09aa1d7ae..000000000 --- a/make.arch/cray-xd1_pg_mpich.h +++ /dev/null @@ -1,58 +0,0 @@ -###################################################### -# Include file with machine-specific definitions # -# for building PDAF. # -# # -# Variant for Cray XD1 with PG fortran compiler # -# with MPI (MPICH) at AWI. # -# # -# In the case of compilation without MPI, a dummy # -# implementation of MPI, like provided in the # -# directory nullmpi/ has to be linked when building # -# an executable. # -###################################################### -# $Id: cray-xd1_pg_mpich.h 1565 2015-02-28 17:04:41Z lnerger $ - - -# Compiler, Linker, and Archiver -FC = mpif90 -LD = mpif90 -AR = ar -RANLIB = ranlib - -# C preprocessor -# (only required, if preprocessing is not performed via the compiler) -CPP = /usr/bin/cpp - -# Definitions for CPP -# Define USE_PDAF to include PDAF -# Define BLOCKING_MPI_EXCHANGE to use blocking MPI commands to exchange data between model and PDAF -# (if the compiler does not support get_command_argument() -# from Fortran 2003 you should define F77 here.) -CPP_DEFS = -DUSE_PDAF - -# Optimization specs for compiler -# (You should explicitly define double precision for floating point -# variables in the compilation) -OPT= -O3 -r8 - -# Optimization specifications for Linker -OPT_LNK = $(OPT) - -# Linking libraries (BLAS, LAPACK, if required: MPI) -LINK_LIBS = -llapack -lblas -lm -lmpich - -# Specifications for the archiver -AR_SPEC = - -# Specifications for ranlib -RAN_SPEC = - -# Include path for MPI header file -MPI_INC = - -# Object for nullMPI - if compiled without MPI library -OBJ_MPI= - -# NetCDF (only required for Lorenz96) -NC_LIB = -NC_INC = diff --git a/make.arch/cray_cce_mpi.h b/make.arch/cray_cce_mpi.h index 35ac1f507..e6335c219 100644 --- a/make.arch/cray_cce_mpi.h +++ b/make.arch/cray_cce_mpi.h @@ -47,6 +47,9 @@ AR_SPEC = # Specifications for ranlib RAN_SPEC = +# Specification for directory holding modules (-module for Intel or Cray, -J for GNU) +MODULEOPT = -module + # Include path for MPI header file MPI_INC = diff --git a/make.arch/cray_cce_mvapich.h b/make.arch/cray_cce_mvapich.h index 70429df23..dd686b0a3 100644 --- a/make.arch/cray_cce_mvapich.h +++ b/make.arch/cray_cce_mvapich.h @@ -47,6 +47,9 @@ AR_SPEC = # Specifications for ranlib RAN_SPEC = +# Specification for directory holding modules (-module for Intel, -J for GNU) +MODULEOPT = -module + # Include path for MPI header file MPI_INC = diff --git a/make.arch/cray_ifort.h b/make.arch/cray_ifort.h index e0fef63ee..9761135d8 100644 --- a/make.arch/cray_ifort.h +++ b/make.arch/cray_ifort.h @@ -38,8 +38,6 @@ OPT_LNK = $(OPT) # Linking libraries (BLAS, LAPACK, if required: MPI) LINK_LIBS = -mkl -qopenmp -#-Wl,--start-group $(MKLROOT)/lib/intel64/libmkl_intel_lp64.a $(MKLROOT)/lib/intel64/libmkl_intel_thread.a $(MKLROOT)/lib/intel64/libmkl_core.a -Wl,--end-group -openmp -lpthread -lm - # Specifications for the archiver AR_SPEC = @@ -47,6 +45,9 @@ AR_SPEC = # Specifications for ranlib RAN_SPEC = +# Specification for directory holding modules (-module for Intel, -J for GNU) +MODULEOPT = -module + # Include path for MPI header file MPI_INC = -Idummympi diff --git a/make.arch/cray_intel_mpi.h b/make.arch/cray_intel_mpi.h index 208d14adf..ae28bfbde 100644 --- a/make.arch/cray_intel_mpi.h +++ b/make.arch/cray_intel_mpi.h @@ -47,6 +47,9 @@ AR_SPEC = # Specifications for ranlib RAN_SPEC = +# Specification for directory holding modules (-module for Intel, -J for GNU) +MODULEOPT = -module + # Include path for MPI header file MPI_INC = diff --git a/make.arch/cray_mpiifort_impi.h b/make.arch/cray_mpiifort_impi.h index cf505c78c..0c9be3ece 100644 --- a/make.arch/cray_mpiifort_impi.h +++ b/make.arch/cray_mpiifort_impi.h @@ -47,6 +47,9 @@ AR_SPEC = # Specifications for ranlib RAN_SPEC = +# Specification for directory holding modules (-module for Intel, -J for GNU) +MODULEOPT = -module + # Include path for MPI header file MPI_INC = diff --git a/make.arch/ibm_blizzard.h b/make.arch/ibm_blizzard.h deleted file mode 100644 index a6aee71a0..000000000 --- a/make.arch/ibm_blizzard.h +++ /dev/null @@ -1,50 +0,0 @@ -###################################################### -# Include file with machine-specific definitions # -# for building PDAF with the dummy model example. # -# # -# Variant for blizzard at DKRZ # -# # -# Thanks to Jan Saynisch, GFZ Potsdam, for this. # -# # -###################################################### -# $Id: ibm_blizzard.h 854 2010-02-02 13:56:53Z lnerger $ - -# Compiler, Linker, and Archiver -FC = mpxlf -LD = mpxlf -AR = ar -RANLIB = ranlib - -# C preprocessor -# (only required, if preprocessing is not performed via the compiler) -CPP = /usr/bin/cpp - -# Definitions for CPP -# Define USE_PDAF to activate PDAF -# (if the compiler does not support get_command_argument() -# from Fortran 2003 you should define F77 here.) -CPP_DEFS = -WF,-DUSE_PDAF - - -# Optimization specs for compiler -OPT= -q64 -O3 -qrealsize=8 -qextname -qlibessl - -# Optimization specifications for Linker -OPT_LNK = $(OPT) - -# Linking libraries (BLAS, LAPACK, if required: MPI) -LINK_LIBS = -L/sw/aix53/lapack-3.2.0/lib -llapack -lessl - -# Specifications for the archiver -AR_SPEC = -X64 - -# Include path for MPI header file -MPI_INC = - -# Object for nullMPI - if compiled without MPI library -OBJ_MPI= - -# NetCDF (only required for Lorenz96) -NC_LIB = -NC_INC = - diff --git a/make.arch/ibm_xlf_mpi.h b/make.arch/ibm_xlf_mpi.h index 982ca0997..f0c27c8d9 100644 --- a/make.arch/ibm_xlf_mpi.h +++ b/make.arch/ibm_xlf_mpi.h @@ -47,6 +47,9 @@ AR_SPEC = -X64 # Specifications for ranlib RAN_SPEC = +# Specification for directory holding modules (-module for Intel, -J for GNU) +MODULEOPT = -I_DONT_KNOW + # Include path for MPI header file MPI_INC = -I/usr/lpp/ppe.poe/include diff --git a/make.arch/linux_ifort_sgimpt.h b/make.arch/linux_gfortran.h similarity index 75% rename from make.arch/linux_ifort_sgimpt.h rename to make.arch/linux_gfortran.h index 0591cd3e4..67e28ba94 100644 --- a/make.arch/linux_ifort_sgimpt.h +++ b/make.arch/linux_gfortran.h @@ -2,22 +2,21 @@ # Include file with machine-specific definitions # # for building PDAF. # # # -# Variant for HLRN-II (SGI Altix ICE with Linux # -# and ifort and MVAPICH 2) # +# Variant for Linux with gfortran and OpenMPI # # # # In the case of compilation without MPI, a dummy # # implementation of MPI, like provided in the # # directory nullmpi/ has to be linked when building # # an executable. # ###################################################### -# $Id: linux_ifort_mvapich2.h 1187 2011-09-16 08:14:28Z lnerger $ +# $Id: linux_gfortran_openmpi.h 1565 2015-02-28 17:04:41Z lnerger $ # Compiler, Linker, and Archiver FC = mpif90 LD = $(FC) AR = ar -RANLIB = ranlib +RANLIB = ranlib # C preprocessor # (only required, if preprocessing is not performed via the compiler) @@ -26,20 +25,22 @@ CPP = /usr/bin/cpp # Definitions for CPP # Define USE_PDAF to include PDAF # Define BLOCKING_MPI_EXCHANGE to use blocking MPI commands to exchange data between model and PDAF +# Define PDAF_NO_UPDATE to deactivate the analysis step of the filter # (if the compiler does not support get_command_argument() # from Fortran 2003 you should define F77 here.) CPP_DEFS = -DUSE_PDAF # Optimization specs for compiler +# To use OpenMP parallelization in PDAF, specify it here (-fopenmp (gfortran) or -openmp (ifort)) # (You should explicitly define double precision for floating point # variables in the compilation) -OPT= -O3 -xHOST -r8 +OPT = -O3 -fdefault-real-8 # Optimization specifications for Linker OPT_LNK = $(OPT) # Linking libraries (BLAS, LAPACK, if required: MPI) -LINK_LIBS = -Wl,--start-group $(MKLROOT)/lib/intel64/libmkl_intel_lp64.a $(MKLROOT)/lib/intel64/libmkl_intel_thread.a $(MKLROOT)/lib/intel64/libmkl_core.a -Wl,--end-group -openmp -lpthread -lm +LINK_LIBS =-L/usr/lib -llapack -lblas -lm # Specifications for the archiver AR_SPEC = @@ -47,11 +48,14 @@ AR_SPEC = # Specifications for ranlib RAN_SPEC = +# Specification for directory holding modules (-module for Intel, -J for GNU) +MODULEOPT = -J + # Include path for MPI header file MPI_INC = # Object for nullMPI - if compiled without MPI library -OBJ_MPI = +OBJ_MPI = # NetCDF (only required for Lorenz96) NC_LIB = diff --git a/make.arch/linux_ifort_impi.h b/make.arch/linux_ifort_impi.h index 5d9410647..f80c69b69 100644 --- a/make.arch/linux_ifort_impi.h +++ b/make.arch/linux_ifort_impi.h @@ -47,6 +47,9 @@ AR_SPEC = # Specifications for ranlib RAN_SPEC = +# Specification for directory holding modules (-module for Intel, -J for GNU) +MODULEOPT = -module + # Include path for MPI header file MPI_INC = diff --git a/make.arch/linux_ifort_mvapich2.h b/make.arch/linux_ifort_mvapich2.h index fce005b16..8fbe6980b 100644 --- a/make.arch/linux_ifort_mvapich2.h +++ b/make.arch/linux_ifort_mvapich2.h @@ -47,6 +47,9 @@ AR_SPEC = # Specifications for ranlib RAN_SPEC = +# Specification for directory holding modules (-module for Intel, -J for GNU) +MODULEOPT = -module + # Include path for MPI header file MPI_INC = diff --git a/make.arch/linux_ifort_sgi.h b/make.arch/linux_ifort_sgi.h deleted file mode 100644 index 26eb54179..000000000 --- a/make.arch/linux_ifort_sgi.h +++ /dev/null @@ -1,57 +0,0 @@ -###################################################### -# Include file with machine-specific definitions # -# for building PDAF. # -# # -# Variant for HLRN-II (SGI Altix ICE with Linux # -# and ifort and MVAPICH 2) # -# # -# In the case of compilation without MPI, a dummy # -# implementation of MPI, like provided in the # -# directory nullmpi/ has to be linked when building # -# an executable. # -###################################################### -# $Id: linux_ifort_mvapich2.h 1187 2011-09-16 08:14:28Z lnerger $ - - -# Compiler, Linker, and Archiver -FC = ifort -LD = $(FC) -AR = ar -RANLIB = ranlib - -# C preprocessor -# (only required, if preprocessing is not performed via the compiler) -CPP = /usr/bin/cpp - -# Definitions for CPP -# Define USE_PDAF to include PDAF -# (if the compiler does not support get_command_argument() -# from Fortran 2003 you should define F77 here.) -CPP_DEFS = -DUSE_PDAF - -# Optimization specs for compiler -# (You should explicitly define double precision for floating point -# variables in the compilation) -OPT= -O3 -xHOST -r8 - -# Optimization specifications for Linker -OPT_LNK = $(OPT) - -# Linking libraries (BLAS, LAPACK, if required: MPI) -LINK_LIBS = -Wl,--start-group $(MKLROOT)/lib/intel64/libmkl_intel_lp64.a $(MKLROOT)/lib/intel64/libmkl_intel_thread.a $(MKLROOT)/lib/intel64/libmkl_core.a -Wl,--end-group -openmp -lpthread -lm - -# Specifications for the archiver -AR_SPEC = - -# Specifications for ranlib -RAN_SPEC = - -# Include path for MPI header file -MPI_INC = -Idummympi - -# Object for nullMPI - if compiled without MPI library -OBJ_MPI = nullmpi.o - -# NetCDF (only required for Lorenz96) -NC_LIB = -NC_INC = diff --git a/make.arch/linux_mpiifort_impi.h b/make.arch/linux_mpiifort_impi.h index 5d9410647..f80c69b69 100644 --- a/make.arch/linux_mpiifort_impi.h +++ b/make.arch/linux_mpiifort_impi.h @@ -47,6 +47,9 @@ AR_SPEC = # Specifications for ranlib RAN_SPEC = +# Specification for directory holding modules (-module for Intel, -J for GNU) +MODULEOPT = -module + # Include path for MPI header file MPI_INC = diff --git a/make.arch/linux_pgi_openmpi.h b/make.arch/linux_pgi_openmpi.h deleted file mode 100644 index 933d34763..000000000 --- a/make.arch/linux_pgi_openmpi.h +++ /dev/null @@ -1,57 +0,0 @@ -###################################################### -# Include file with machine-specific definitions # -# for building PDAF. # -# # -# Variant for Linux with PGI Compiler and OpenMPI # -# at DKRZ (tornado.dkrz.de) # -# # -# In the case of compilation without MPI, a dummy # -# implementation of MPI, like provided in the # -# directory nullmpi/ has to be linked when building # -# an executable. # -###################################################### -# $Id: linux_pgi_openmpi.h 1580 2015-06-07 08:15:58Z lnerger $ - - -# Compiler, Linker, and Archiver -FC = mpif90 -LD = $(FC) -AR = ar -RANLIB = ranlib - -# C preprocessor -# (only required, if preprocessing is not performed via the compiler) -CPP = /usr/bin/cpp - -# Definitions for CPP -# Define BLOCKING_MPI_EXCHANGE to use blocking MPI commands to exchange data between model and PDAF -# (if the compiler does not support get_command_argument() -# from Fortran 2003 you should define F77 here.) -CPP_DEFS = -DUSE_PDAF - -# Optimization specs for compiler -# (You should explicitly define double precision for floating point -# variables in the compilation) -OPT= -O3 -fast -Mr8 -Mr8intrinsics -Mbyteswapio -Mpreprocess - -# Optimization specifications for Linker -OPT_LNK = $(OPT) - -# Linking libraries (BLAS, LAPACK, if required: MPI) -LINK_LIBS = -L/sw/sles9-x64/acml-3.6.0/pgi64/lib -lacml -lacml_mv -Bstatic - -# Specifications for the archiver -AR_SPEC = - -# Specifications for ranlib -RAN_SPEC = - -# Include path for MPI header file -MPI_INC = - -# Object for nullMPI - if compiled without MPI library -OBJ_MPI = - -# NetCDF (only required for Lorenz96) -NC_LIB = -NC_INC = diff --git a/make.arch/macos_gfortran_openmpi.h b/make.arch/macos_gfortran_openmpi.h index a8e96be78..dde0f4841 100644 --- a/make.arch/macos_gfortran_openmpi.h +++ b/make.arch/macos_gfortran_openmpi.h @@ -49,6 +49,9 @@ AR_SPEC = # Specifications for ranlib RAN_SPEC = +# Specification for directory holding modules (-module for Intel, -J for GNU) +MODULEOPT = -J + # Include path for MPI header file MPI_INC = diff --git a/make.arch/macos_gfortran_snglprec.h b/make.arch/macos_gfortran_snglprec.h index c7e3d925e..8fa56b6b8 100644 --- a/make.arch/macos_gfortran_snglprec.h +++ b/make.arch/macos_gfortran_snglprec.h @@ -49,6 +49,9 @@ AR_SPEC = # Specifications for ranlib RAN_SPEC = +# Specification for directory holding modules (-module for Intel, -J for GNU) +MODULEOPT = -J + # Include path for MPI header file MPI_INC = diff --git a/make.arch/nec_sxace.h b/make.arch/nec_sxace.h index 87812773c..c0b11ac76 100644 --- a/make.arch/nec_sxace.h +++ b/make.arch/nec_sxace.h @@ -45,6 +45,9 @@ AR_SPEC = # Specifications for ranlib RAN_SPEC = +# Specification for directory holding modules (-module for Intel, -J for GNU) +MODULEOPT = -module + # Include path for MPI header file MPI_INC = -Idummympi diff --git a/make.arch/osx_gfortran_openmpi.h b/make.arch/osx_gfortran_openmpi.h index 7243c6a74..ce19b31be 100644 --- a/make.arch/osx_gfortran_openmpi.h +++ b/make.arch/osx_gfortran_openmpi.h @@ -48,6 +48,9 @@ AR_SPEC = # Specifications for ranlib RAN_SPEC = +# Specification for directory holding modules (-module for Intel, -J for GNU) +MODULEOPT = -J + # Include path for MPI header file MPI_INC = diff --git a/make.arch/osx_gfortran_snglprec.h b/make.arch/osx_gfortran_snglprec.h index f67cd653f..42b00e896 100644 --- a/make.arch/osx_gfortran_snglprec.h +++ b/make.arch/osx_gfortran_snglprec.h @@ -48,6 +48,9 @@ AR_SPEC = # Specifications for ranlib RAN_SPEC = +# Specification for directory holding modules (-module for Intel, -J for GNU) +MODULEOPT = -J + # Include path for MPI header file MPI_INC = diff --git a/make.arch/sgi-irix_mpi.h b/make.arch/sgi-irix_mpi.h deleted file mode 100644 index 6f6868ffd..000000000 --- a/make.arch/sgi-irix_mpi.h +++ /dev/null @@ -1,57 +0,0 @@ -###################################################### -# Include file with machine-specific definitions # -# for building PDAF. # -# # -# Variant for SGI Origin 2000 at AWI using MPI. # -# # -# In the case of compilation without MPI, a dummy # -# implementation of MPI, like provided in the # -# directory nullmpi/ has to be linked when building # -# an executable. # -###################################################### -# $Id: sgi-irix_mpi.h 1565 2015-02-28 17:04:41Z lnerger $ - - -# Compiler, Linker, and Archiver -FC = f90 -LD = f90 -AR = ar -RANLIB = ranlib - -# C preprocessor -# (only required, if preprocessing is not performed via the compiler) -CPP = /lib/cpp - -# Definitions for CPP -# Define USE_PDAF to include PDAF -# Define BLOCKING_MPI_EXCHANGE to use blocking MPI commands to exchange data between model and PDAF -# (if the compiler does not support get_command_argument() -# from Fortran 2003 you should define F77 here.) -CPP_DEFS = -DF77 - -# Optimization specs for compiler -# (You should explicitly define double precision for floating point -# variables in the compilation) -OPT= -r8 -O3 - -# Optimization specifications for Linker -OPT_LNK = $(OPT) - -# Linking libraries (BLAS, LAPACK, if required: MPI) -LINK_LIBS = -lblas -lscs -lmpi - -# Specifications for the archiver -AR_SPEC = - -# Specifications for ranlib -RAN_SPEC = - -# Include path for MPI header file -MPI_INC = - -# Object for nullMPI - if compiled without MPI library -OBJ_MPI = - -# NetCDF (only required for Lorenz96) -NC_LIB = -NC_INC = diff --git a/make.arch/sun_studio.h b/make.arch/sun_studio.h deleted file mode 100644 index f7535e6ae..000000000 --- a/make.arch/sun_studio.h +++ /dev/null @@ -1,57 +0,0 @@ -###################################################### -# Include file with machine-specific definitions # -# for building PDAF. # -# # -# Variant for Sun with Sun Studio 12 Compiler at AWI # -# without MPI. # -# # -# In the case of compilation without MPI, a dummy # -# implementation of MPI, like provided in the # -# directory nullmpi/ has to be linked when building # -# an executable. # -###################################################### -# $Id: sun_studio.h 850 2010-02-02 09:53:06Z lnerger $ - - -# Compiler, Linker, and Archiver -FC = f90 -LD = f90 -AR = ar -RANLIB = ranlib - -# C preprocessor -# (only required, if preprocessing is not performed via the compiler) -CPP = /usr/ccs/lib/cpp - -# Definitions for CPP -# Define USE_PDAF to include PDAF -# (if the compiler does not support get_command_argument() -# from Fortran 2003 you should define F77 here.) -CPP_DEFS = - -# Optimization specs for compiler -# (You should explicitly define double precision for floating point -# variables in the compilation) -OPT= -fast -xtypemap=real:64 -m64 - -# Optimization specifications for Linker -OPT_LNK = $(OPT) - -# Linking libraries (BLAS, LAPACK, if required: MPI) -LINK_LIBS = -xlic_lib=sunperf - -# Specifications for the archiver -AR_SPEC = - -# Specifications for ranlib -RAN_SPEC = - -# Include path for MPI header file -MPI_INC = -Idummympi - -# Object for nullMPI - if compiled without MPI library -OBJ_MPI = nullmpi.o - -# NetCDF (only required for Lorenz96) -NC_LIB = -NC_INC = diff --git a/make.arch/windows_gfortran.h b/make.arch/windows_gfortran.h deleted file mode 100644 index df50a1f38..000000000 --- a/make.arch/windows_gfortran.h +++ /dev/null @@ -1,57 +0,0 @@ -###################################################### -# Include file with machine-specific definitions # -# for building PDAF. # -# # -# Variant for Windows with gfortran using Cygwin # -# without MPI. # -# # -# In the case of compilation without MPI, a dummy # -# implementation of MPI, like provided in the # -# directory nullmpi/ has to be linked when building # -# an executable. # -###################################################### -# $Id: linux_gfortran.h 1235 2012-01-19 08:38:11Z lnerger $ - - -# Compiler, Linker, and Archiver -FC = gfortran -LD = gfortran -AR = ar -RANLIB = ranlib - -# C preprocessor -# (only required, if preprocessing is not performed via the compiler) -CPP = /usr/bin/cpp - -# Definitions for CPP -# Define USE_PDAF to include PDAF -# (if the compiler does not support get_command_argument() -# from Fortran 2003 you should define F77 here.) -CPP_DEFS = -DUSE_PDAF - -# Optimization specs for compiler -# (You should explicitly define double precision for floating point -# variables in the compilation) -OPT = -O3 -fdefault-real-8 - -# Optimization specifications for Linker -OPT_LNK = $(OPT) - -# Linking libraries (BLAS, LAPACK, if required: MPI) -LINK_LIBS =-L/usr/lib -llapack -lblas -lm - -# Specifications for the archiver -AR_SPEC = - -# Specifications for ranlib -RAN_SPEC = - -# Include path for MPI header file -MPI_INC = -Idummympi - -# Object for nullMPI - if compiled without MPI library -OBJ_MPI = nullmpi.o - -# NetCDF (only required for Lorenz96) -NC_LIB = -L/usr/lib -lnetcdf -lnetcdff -NC_INC = -I/usr/include diff --git a/make.arch/windows_gfortran_openmpi.h b/make.arch/windows_gfortran_openmpi.h index 1796d27ae..552fded77 100644 --- a/make.arch/windows_gfortran_openmpi.h +++ b/make.arch/windows_gfortran_openmpi.h @@ -48,6 +48,9 @@ AR_SPEC = # Specifications for ranlib RAN_SPEC = +# Specification for directory holding modules (-module for Intel, -J for GNU) +MODULEOPT = -module + # Include path for MPI header file MPI_INC = diff --git a/models/classical/lorenz05b/parser_mpi.F90 b/models/classical/lorenz05b/parser_mpi.F90 index fadaf0ccd..f1ed34aa7 100644 --- a/models/classical/lorenz05b/parser_mpi.F90 +++ b/models/classical/lorenz05b/parser_mpi.F90 @@ -57,6 +57,8 @@ MODULE parser ! ! !USES: USE mpi + USE mod_parallel, & + ONLY: abort_parallel IMPLICIT NONE SAVE @@ -191,6 +193,8 @@ SUBROUTINE parse_string(handle, charvalue) ! *** local variables *** CHARACTER(len=100) :: string CHARACTER(len=100) :: parsed_string + CHARACTER(len=110) :: str1_check + CHARACTER(len=110) :: str2_check LOGICAL :: modified ! *** Initialize *** @@ -210,9 +214,27 @@ SUBROUTINE parse_string(handle, charvalue) DO i = 1, command_argument_count() - 1 CALL get_command_argument(i, str1) CALL get_command_argument(i+1, str2) + + ! Add check for inadmissible strings longer than 100 + ! characters + CALL get_command_argument(i, str1_check) + CALL get_command_argument(i+1, str2_check) + IF (mype == 0) THEN + IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN + WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long." + WRITE (*,'(2x, a, 1x, a)') "called handle=", TRIM(string) + WRITE (*,'(2x, a, 1x, a)') "parsed handle=", TRIM(str1) + WRITE (*,'(2x, a, 1x, a)') "parsed input(cut)=", TRIM(str2) + call abort_parallel() + END IF + END IF + + #endif IF (str1 == TRIM(string)) THEN - READ(str2, *) parsed_string + ! Format specifier is needed for reading paths. Using + ! `*` as format specifier, reading stops at a `/` + READ(str2, '(a)') parsed_string modified = .TRUE. END IF ENDDO diff --git a/models/classical/lorenz05c/parser_mpi.F90 b/models/classical/lorenz05c/parser_mpi.F90 index fadaf0ccd..f1ed34aa7 100644 --- a/models/classical/lorenz05c/parser_mpi.F90 +++ b/models/classical/lorenz05c/parser_mpi.F90 @@ -57,6 +57,8 @@ MODULE parser ! ! !USES: USE mpi + USE mod_parallel, & + ONLY: abort_parallel IMPLICIT NONE SAVE @@ -191,6 +193,8 @@ SUBROUTINE parse_string(handle, charvalue) ! *** local variables *** CHARACTER(len=100) :: string CHARACTER(len=100) :: parsed_string + CHARACTER(len=110) :: str1_check + CHARACTER(len=110) :: str2_check LOGICAL :: modified ! *** Initialize *** @@ -210,9 +214,27 @@ SUBROUTINE parse_string(handle, charvalue) DO i = 1, command_argument_count() - 1 CALL get_command_argument(i, str1) CALL get_command_argument(i+1, str2) + + ! Add check for inadmissible strings longer than 100 + ! characters + CALL get_command_argument(i, str1_check) + CALL get_command_argument(i+1, str2_check) + IF (mype == 0) THEN + IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN + WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long." + WRITE (*,'(2x, a, 1x, a)') "called handle=", TRIM(string) + WRITE (*,'(2x, a, 1x, a)') "parsed handle=", TRIM(str1) + WRITE (*,'(2x, a, 1x, a)') "parsed input(cut)=", TRIM(str2) + call abort_parallel() + END IF + END IF + + #endif IF (str1 == TRIM(string)) THEN - READ(str2, *) parsed_string + ! Format specifier is needed for reading paths. Using + ! `*` as format specifier, reading stops at a `/` + READ(str2, '(a)') parsed_string modified = .TRUE. END IF ENDDO diff --git a/models/classical/lorenz63/parser_mpi.F90 b/models/classical/lorenz63/parser_mpi.F90 index fd31ab325..d4008aca4 100644 --- a/models/classical/lorenz63/parser_mpi.F90 +++ b/models/classical/lorenz63/parser_mpi.F90 @@ -57,6 +57,8 @@ MODULE parser ! ! !USES: USE mpi + USE mod_parallel, & + ONLY: abort_parallel IMPLICIT NONE SAVE @@ -191,6 +193,8 @@ SUBROUTINE parse_string(handle, charvalue) ! *** local variables *** CHARACTER(len=100) :: string CHARACTER(len=100) :: parsed_string + CHARACTER(len=110) :: str1_check + CHARACTER(len=110) :: str2_check LOGICAL :: modified ! *** Initialize *** @@ -210,9 +214,27 @@ SUBROUTINE parse_string(handle, charvalue) DO i = 1, command_argument_count() - 1 CALL get_command_argument(i, str1) CALL get_command_argument(i+1, str2) + + ! Add check for inadmissible strings longer than 100 + ! characters + CALL get_command_argument(i, str1_check) + CALL get_command_argument(i+1, str2_check) + IF (mype == 0) THEN + IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN + WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long." + WRITE (*,'(2x, a, 1x, a)') "called handle=", TRIM(string) + WRITE (*,'(2x, a, 1x, a)') "parsed handle=", TRIM(str1) + WRITE (*,'(2x, a, 1x, a)') "parsed input(cut)=", TRIM(str2) + call abort_parallel() + END IF + END IF + + #endif IF (str1 == TRIM(string)) THEN - READ(str2, *) parsed_string + ! Format specifier is needed for reading paths. Using + ! `*` as format specifier, reading stops at a `/` + READ(str2, '(a)') parsed_string modified = .TRUE. END IF ENDDO diff --git a/models/classical/lorenz96/parser_mpi.F90 b/models/classical/lorenz96/parser_mpi.F90 index fd31ab325..d4008aca4 100644 --- a/models/classical/lorenz96/parser_mpi.F90 +++ b/models/classical/lorenz96/parser_mpi.F90 @@ -57,6 +57,8 @@ MODULE parser ! ! !USES: USE mpi + USE mod_parallel, & + ONLY: abort_parallel IMPLICIT NONE SAVE @@ -191,6 +193,8 @@ SUBROUTINE parse_string(handle, charvalue) ! *** local variables *** CHARACTER(len=100) :: string CHARACTER(len=100) :: parsed_string + CHARACTER(len=110) :: str1_check + CHARACTER(len=110) :: str2_check LOGICAL :: modified ! *** Initialize *** @@ -210,9 +214,27 @@ SUBROUTINE parse_string(handle, charvalue) DO i = 1, command_argument_count() - 1 CALL get_command_argument(i, str1) CALL get_command_argument(i+1, str2) + + ! Add check for inadmissible strings longer than 100 + ! characters + CALL get_command_argument(i, str1_check) + CALL get_command_argument(i+1, str2_check) + IF (mype == 0) THEN + IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN + WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long." + WRITE (*,'(2x, a, 1x, a)') "called handle=", TRIM(string) + WRITE (*,'(2x, a, 1x, a)') "parsed handle=", TRIM(str1) + WRITE (*,'(2x, a, 1x, a)') "parsed input(cut)=", TRIM(str2) + call abort_parallel() + END IF + END IF + + #endif IF (str1 == TRIM(string)) THEN - READ(str2, *) parsed_string + ! Format specifier is needed for reading paths. Using + ! `*` as format specifier, reading stops at a `/` + READ(str2, '(a)') parsed_string modified = .TRUE. END IF ENDDO diff --git a/models/lorenz05b/Makefile b/models/lorenz05b/Makefile index 64008ccf9..e90587f72 100644 --- a/models/lorenz05b/Makefile +++ b/models/lorenz05b/Makefile @@ -116,7 +116,7 @@ pdaf_lorenz_05b : libpdaf-d.a \ libpdaf-d.a: @echo "++++++ Generate Filter library ++++++" - @cd $(BASEDIR)/src; make; + @cd $(BASEDIR); make; ###################################################### @@ -144,7 +144,7 @@ cleandata: cleanpdaf: @echo "+++ Clean up PDAF directory" - cd $(BASEDIR)/src; make clean + cd $(BASEDIR); make clean ###################################################### diff --git a/models/lorenz05b/parser_mpi.F90 b/models/lorenz05b/parser_mpi.F90 index fadaf0ccd..f1ed34aa7 100644 --- a/models/lorenz05b/parser_mpi.F90 +++ b/models/lorenz05b/parser_mpi.F90 @@ -57,6 +57,8 @@ MODULE parser ! ! !USES: USE mpi + USE mod_parallel, & + ONLY: abort_parallel IMPLICIT NONE SAVE @@ -191,6 +193,8 @@ SUBROUTINE parse_string(handle, charvalue) ! *** local variables *** CHARACTER(len=100) :: string CHARACTER(len=100) :: parsed_string + CHARACTER(len=110) :: str1_check + CHARACTER(len=110) :: str2_check LOGICAL :: modified ! *** Initialize *** @@ -210,9 +214,27 @@ SUBROUTINE parse_string(handle, charvalue) DO i = 1, command_argument_count() - 1 CALL get_command_argument(i, str1) CALL get_command_argument(i+1, str2) + + ! Add check for inadmissible strings longer than 100 + ! characters + CALL get_command_argument(i, str1_check) + CALL get_command_argument(i+1, str2_check) + IF (mype == 0) THEN + IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN + WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long." + WRITE (*,'(2x, a, 1x, a)') "called handle=", TRIM(string) + WRITE (*,'(2x, a, 1x, a)') "parsed handle=", TRIM(str1) + WRITE (*,'(2x, a, 1x, a)') "parsed input(cut)=", TRIM(str2) + call abort_parallel() + END IF + END IF + + #endif IF (str1 == TRIM(string)) THEN - READ(str2, *) parsed_string + ! Format specifier is needed for reading paths. Using + ! `*` as format specifier, reading stops at a `/` + READ(str2, '(a)') parsed_string modified = .TRUE. END IF ENDDO diff --git a/models/lorenz05b/tools/Makefile b/models/lorenz05b/tools/Makefile index 90579139d..0d06b88de 100644 --- a/models/lorenz05b/tools/Makefile +++ b/models/lorenz05b/tools/Makefile @@ -32,7 +32,7 @@ EXE_COVAR = generate_covar ###################################################### info: - @echo "Makefile to build tool programs for the Lorenz05b model"; + @echo "Makefile to build tool programs for the Lorenz96 model"; @echo "-------------------------------------------------------------------------------"; @echo "Use as make TARGET where TARGET can be:"; @echo " info - This text"; @@ -66,7 +66,7 @@ all: $(EXE_GENOBS) $(EXE_COVAR) libpdaf-d.a: @echo "++++++ Generate Filter library ++++++" - @cd $(BASEDIR)/src; make; + @cd $(BASEDIR); make; clean : diff --git a/models/lorenz05c/Makefile b/models/lorenz05c/Makefile index 6e3a94b8d..0d23eb24d 100644 --- a/models/lorenz05c/Makefile +++ b/models/lorenz05c/Makefile @@ -116,7 +116,7 @@ pdaf_lorenz_05c : libpdaf-d.a \ libpdaf-d.a: @echo "++++++ Generate Filter library ++++++" - @cd $(BASEDIR)/src; make; + @cd $(BASEDIR); make; ###################################################### @@ -144,7 +144,7 @@ cleandata: cleanpdaf: @echo "+++ Clean up PDAF directory" - cd $(BASEDIR)/src; make clean + cd $(BASEDIR); make clean ###################################################### diff --git a/models/lorenz05c/parser_mpi.F90 b/models/lorenz05c/parser_mpi.F90 index fadaf0ccd..f1ed34aa7 100644 --- a/models/lorenz05c/parser_mpi.F90 +++ b/models/lorenz05c/parser_mpi.F90 @@ -57,6 +57,8 @@ MODULE parser ! ! !USES: USE mpi + USE mod_parallel, & + ONLY: abort_parallel IMPLICIT NONE SAVE @@ -191,6 +193,8 @@ SUBROUTINE parse_string(handle, charvalue) ! *** local variables *** CHARACTER(len=100) :: string CHARACTER(len=100) :: parsed_string + CHARACTER(len=110) :: str1_check + CHARACTER(len=110) :: str2_check LOGICAL :: modified ! *** Initialize *** @@ -210,9 +214,27 @@ SUBROUTINE parse_string(handle, charvalue) DO i = 1, command_argument_count() - 1 CALL get_command_argument(i, str1) CALL get_command_argument(i+1, str2) + + ! Add check for inadmissible strings longer than 100 + ! characters + CALL get_command_argument(i, str1_check) + CALL get_command_argument(i+1, str2_check) + IF (mype == 0) THEN + IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN + WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long." + WRITE (*,'(2x, a, 1x, a)') "called handle=", TRIM(string) + WRITE (*,'(2x, a, 1x, a)') "parsed handle=", TRIM(str1) + WRITE (*,'(2x, a, 1x, a)') "parsed input(cut)=", TRIM(str2) + call abort_parallel() + END IF + END IF + + #endif IF (str1 == TRIM(string)) THEN - READ(str2, *) parsed_string + ! Format specifier is needed for reading paths. Using + ! `*` as format specifier, reading stops at a `/` + READ(str2, '(a)') parsed_string modified = .TRUE. END IF ENDDO diff --git a/models/lorenz05c/tools/Makefile b/models/lorenz05c/tools/Makefile index 76a7c9577..0d06b88de 100644 --- a/models/lorenz05c/tools/Makefile +++ b/models/lorenz05c/tools/Makefile @@ -32,7 +32,7 @@ EXE_COVAR = generate_covar ###################################################### info: - @echo "Makefile to build tool programs for the Lorenz05c model"; + @echo "Makefile to build tool programs for the Lorenz96 model"; @echo "-------------------------------------------------------------------------------"; @echo "Use as make TARGET where TARGET can be:"; @echo " info - This text"; @@ -66,7 +66,7 @@ all: $(EXE_GENOBS) $(EXE_COVAR) libpdaf-d.a: @echo "++++++ Generate Filter library ++++++" - @cd $(BASEDIR)/src; make; + @cd $(BASEDIR); make; clean : diff --git a/models/lorenz63/Makefile b/models/lorenz63/Makefile index 18935ec21..3921b2ac3 100644 --- a/models/lorenz63/Makefile +++ b/models/lorenz63/Makefile @@ -116,7 +116,7 @@ pdaf_lorenz_63 : libpdaf-d.a \ libpdaf-d.a: @echo "++++++ Generate Filter library ++++++" - @cd $(BASEDIR)/src; make; + @cd $(BASEDIR); make; ###################################################### @@ -144,7 +144,7 @@ cleandata: cleanpdaf: @echo "+++ Clean up PDAF directory" - cd $(BASEDIR)/src; make clean + cd $(BASEDIR); make clean ###################################################### diff --git a/models/lorenz63/parser_mpi.F90 b/models/lorenz63/parser_mpi.F90 index fd31ab325..d4008aca4 100644 --- a/models/lorenz63/parser_mpi.F90 +++ b/models/lorenz63/parser_mpi.F90 @@ -57,6 +57,8 @@ MODULE parser ! ! !USES: USE mpi + USE mod_parallel, & + ONLY: abort_parallel IMPLICIT NONE SAVE @@ -191,6 +193,8 @@ SUBROUTINE parse_string(handle, charvalue) ! *** local variables *** CHARACTER(len=100) :: string CHARACTER(len=100) :: parsed_string + CHARACTER(len=110) :: str1_check + CHARACTER(len=110) :: str2_check LOGICAL :: modified ! *** Initialize *** @@ -210,9 +214,27 @@ SUBROUTINE parse_string(handle, charvalue) DO i = 1, command_argument_count() - 1 CALL get_command_argument(i, str1) CALL get_command_argument(i+1, str2) + + ! Add check for inadmissible strings longer than 100 + ! characters + CALL get_command_argument(i, str1_check) + CALL get_command_argument(i+1, str2_check) + IF (mype == 0) THEN + IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN + WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long." + WRITE (*,'(2x, a, 1x, a)') "called handle=", TRIM(string) + WRITE (*,'(2x, a, 1x, a)') "parsed handle=", TRIM(str1) + WRITE (*,'(2x, a, 1x, a)') "parsed input(cut)=", TRIM(str2) + call abort_parallel() + END IF + END IF + + #endif IF (str1 == TRIM(string)) THEN - READ(str2, *) parsed_string + ! Format specifier is needed for reading paths. Using + ! `*` as format specifier, reading stops at a `/` + READ(str2, '(a)') parsed_string modified = .TRUE. END IF ENDDO diff --git a/models/lorenz63/tools/Makefile b/models/lorenz63/tools/Makefile index 3271eee45..0d06b88de 100644 --- a/models/lorenz63/tools/Makefile +++ b/models/lorenz63/tools/Makefile @@ -9,11 +9,15 @@ ###################################################### + +# Root directory of PDAF package +BASEDIR = ../../.. + # Include machine-specific definitions # For available include files see directory make.arch # To choose a file, set PDAF_ARCH either here or by an # environment variable. -include ../../../make.arch/$(PDAF_ARCH).h +include $(BASEDIR)/make.arch/$(PDAF_ARCH).h ###################################################### @@ -46,12 +50,12 @@ $(EXE_GENOBS) : $(OBJ_GENOBS) $(EXE_COVAR) : libpdaf-d.a $(OBJ_COVAR) rm -f $@ - $(LD) $(OPT) -o $@ $(MODULES) $(OBJ_COVAR) $(NC_LIB) -L../../../lib -lpdaf-d $(LINK_LIBS) + $(LD) $(OPT) -o $@ $(MODULES) $(OBJ_COVAR) $(NC_LIB) -L$(BASEDIR)/lib -lpdaf-d $(LINK_LIBS) all: $(EXE_GENOBS) $(EXE_COVAR) .F90.o : - $(FC) $(OPT) $(MPI_INC) $(CPP_DEFS) $(NC_INC) -c $*.F90 + $(FC) $(OPT) $(CPP_DEFS) $(NC_INC) -c $*.F90 # For older compilers one might need to separate the # preprocessing from the compilation as defined below: @@ -62,7 +66,7 @@ all: $(EXE_GENOBS) $(EXE_COVAR) libpdaf-d.a: @echo "++++++ Generate Filter library ++++++" - @cd ../../../src; make; + @cd $(BASEDIR); make; clean : diff --git a/models/lorenz96/Makefile b/models/lorenz96/Makefile index 8550b9042..b2ca10456 100644 --- a/models/lorenz96/Makefile +++ b/models/lorenz96/Makefile @@ -116,7 +116,7 @@ pdaf_lorenz_96 : libpdaf-d.a \ libpdaf-d.a: @echo "++++++ Generate Filter library ++++++" - @cd $(BASEDIR)/src; make; + @cd $(BASEDIR); make; ###################################################### @@ -144,7 +144,7 @@ cleandata: cleanpdaf: @echo "+++ Clean up PDAF directory" - cd $(BASEDIR)/src; make clean + cd $(BASEDIR); make clean ###################################################### diff --git a/models/lorenz96/parser_mpi.F90 b/models/lorenz96/parser_mpi.F90 index 75810b0aa..d4008aca4 100644 --- a/models/lorenz96/parser_mpi.F90 +++ b/models/lorenz96/parser_mpi.F90 @@ -57,6 +57,9 @@ MODULE parser ! ! !USES: USE mpi + USE mod_parallel, & + ONLY: abort_parallel + IMPLICIT NONE SAVE @@ -190,6 +193,8 @@ SUBROUTINE parse_string(handle, charvalue) ! *** local variables *** CHARACTER(len=100) :: string CHARACTER(len=100) :: parsed_string + CHARACTER(len=110) :: str1_check + CHARACTER(len=110) :: str2_check LOGICAL :: modified ! *** Initialize *** @@ -209,9 +214,27 @@ SUBROUTINE parse_string(handle, charvalue) DO i = 1, command_argument_count() - 1 CALL get_command_argument(i, str1) CALL get_command_argument(i+1, str2) + + ! Add check for inadmissible strings longer than 100 + ! characters + CALL get_command_argument(i, str1_check) + CALL get_command_argument(i+1, str2_check) + IF (mype == 0) THEN + IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN + WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long." + WRITE (*,'(2x, a, 1x, a)') "called handle=", TRIM(string) + WRITE (*,'(2x, a, 1x, a)') "parsed handle=", TRIM(str1) + WRITE (*,'(2x, a, 1x, a)') "parsed input(cut)=", TRIM(str2) + call abort_parallel() + END IF + END IF + + #endif IF (str1 == TRIM(string)) THEN - READ(str2, *) parsed_string + ! Format specifier is needed for reading paths. Using + ! `*` as format specifier, reading stops at a `/` + READ(str2, '(a)') parsed_string modified = .TRUE. END IF ENDDO diff --git a/models/lorenz96/tools/Makefile b/models/lorenz96/tools/Makefile index 8d6971df3..0d06b88de 100644 --- a/models/lorenz96/tools/Makefile +++ b/models/lorenz96/tools/Makefile @@ -66,7 +66,7 @@ all: $(EXE_GENOBS) $(EXE_COVAR) libpdaf-d.a: @echo "++++++ Generate Filter library ++++++" - @cd $(BASEDIR)/src; make; + @cd $(BASEDIR); make; clean : diff --git a/src/Makefile b/src/Makefile index f2c766ffc..76d481a52 100644 --- a/src/Makefile +++ b/src/Makefile @@ -5,7 +5,7 @@ # To choose the architecture set $PDAF_ARCH # ####################################################### -.SUFFIXES: .F90 .f .o +.SUFFIXES: .F90 .f .o ###################################################### @@ -21,13 +21,14 @@ include ../make.arch/$(PDAF_ARCH).h ###################################################### # Modules used in PDAF -MOD_PDAF = PDAF_timer.o \ +MOD_PDAF = PDAF_timer_mpi.o \ PDAF_memcount.o \ PDAF_mod_filtermpi.o \ PDAF_mod_filter.o # Module file with interface definitions -MOD_INTERFACE = PDAF_interfaces_module.o +MOD_INTERFACE = PDAFlocal_interfaces.o \ + PDAF_interfaces_module.o # Generic routines in PDAF OBJ_PDAF_GEN = PDAF_analysis_utils.o \ @@ -87,16 +88,44 @@ OBJ_PDAF_GEN = PDAF_analysis_utils.o \ PDAF_inflate_weights.o \ PDAFomi_put_state_global.o \ PDAFomi_put_state_global_si.o \ + PDAFomi_put_state_global_nondiagR.o \ + PDAFomi_put_state_global_nondiagR_si.o \ + PDAFomi_put_state_nonlin_nondiagR.o \ + PDAFomi_put_state_nonlin_nondiagR_si.o \ PDAFomi_put_state_local.o \ PDAFomi_put_state_local_si.o \ + PDAFomi_put_state_local_nondiagR.o \ + PDAFomi_put_state_local_nondiagR_si.o \ PDAFomi_assimilate_global.o \ PDAFomi_assimilate_global_si.o \ + PDAFomi_assimilate_global_nondiagR.o \ + PDAFomi_assimilate_global_nondiagR_si.o \ + PDAFomi_assimilate_nonlin_nondiagR.o \ + PDAFomi_assimilate_nonlin_nondiagR_si.o \ PDAFomi_assimilate_local.o \ PDAFomi_assimilate_local_si.o \ + PDAFomi_assimilate_local_nondiagR.o \ + PDAFomi_assimilate_local_nondiagR_si.o \ PDAF_reset_forget.o \ PDAF_get_ensstats.o \ PDAF_set_debug_flag.o \ - PDAF_set_offline_mode.o + PDAF_set_offline_mode.o \ + PDAFlocal.o \ + PDAFlocal_set_indices.o \ + PDAFlocal_set_increment_weights.o \ + PDAFlocal_clear_increment_weights.o \ + PDAFlocal_g2l_cb.o \ + PDAFlocal_l2g_cb.o \ + PDAFlocalomi_assimilate.o \ + PDAFlocalomi_assimilate_nondiagR.o \ + PDAFlocalomi_assimilate_nondiagR_si.o \ + PDAFlocalomi_assimilate_si.o \ + PDAFlocalomi_put_state.o \ + PDAFlocalomi_put_state_nondiagR.o \ + PDAFlocalomi_put_state_nondiagR_si.o \ + PDAFlocalomi_put_state_si.o \ + PDAF_correlation_function.o + # Specific PDAF-routines for SEIK OBJ_SEIK = PDAF_seik_init.o \ @@ -130,7 +159,11 @@ OBJ_LSEIK = PDAF_lseik_init.o \ PDAF_lseik_update.o \ PDAF_lseik_analysis.o \ PDAF_lseik_resample.o \ - PDAF_lseik_analysis_trans.o + PDAF_lseik_analysis_trans.o \ + PDAFlocal_put_state_lseik.o \ + PDAFlocal_put_state_lseik_si.o \ + PDAFlocal_assimilate_lseik.o \ + PDAFlocal_assimilate_lseik_si.o # Specific PDAF-routines for SEEK OBJ_SEEK = PDAF_seek_init.o \ @@ -161,7 +194,11 @@ OBJ_ENKF = PDAF_enkf_init.o \ PDAF_enkf_analysis_rsm.o \ PDAF_enkf_omega.o \ PDAF_enkf_Tleft.o \ - PDAF_smoother_enkf.o + PDAF_smoother_enkf.o \ + PDAFomi_put_state_enkf_nondiagR.o \ + PDAFomi_put_state_enkf_nondiagR_si.o \ + PDAFomi_assimilate_enkf_nondiagR.o \ + PDAFomi_assimilate_enkf_nondiagR_si.o # Specific PDAF-routines for ETKF OBJ_ETKF = PDAF_etkf_init.o \ @@ -191,7 +228,11 @@ OBJ_LETKF = PDAF_letkf_init.o \ PDAF_letkf_update.o \ PDAF_letkf_analysis.o \ PDAF_letkf_analysis_T.o \ - PDAF_letkf_analysis_fixed.o + PDAF_letkf_analysis_fixed.o \ + PDAFlocal_put_state_letkf.o \ + PDAFlocal_put_state_letkf_si.o \ + PDAFlocal_assimilate_letkf.o \ + PDAFlocal_assimilate_letkf_si.o # Specific PDAF-routines for ESTKF OBJ_ESTKF = PDAF_estkf_init.o \ @@ -219,7 +260,11 @@ OBJ_LESTKF = PDAF_lestkf_init.o \ PDAF_assimilate_lestkf_si.o \ PDAF_lestkf_update.o \ PDAF_lestkf_analysis.o \ - PDAF_lestkf_analysis_fixed.o + PDAF_lestkf_analysis_fixed.o \ + PDAFlocal_put_state_lestkf.o \ + PDAFlocal_put_state_lestkf_si.o \ + PDAFlocal_assimilate_lestkf.o \ + PDAFlocal_assimilate_lestkf_si.o # Specific PDAF-routines for LEnKF OBJ_LENKF = PDAF_lenkf_init.o \ @@ -230,10 +275,14 @@ OBJ_LENKF = PDAF_lenkf_init.o \ PDAF_put_state_lenkf_si.o \ PDAFomi_put_state_lenkf.o \ PDAFomi_put_state_lenkf_si.o \ + PDAFomi_put_state_lenkf_nondiagR.o \ + PDAFomi_put_state_lenkf_nondiagR_si.o \ PDAF_assimilate_lenkf.o \ PDAF_assimilate_lenkf_si.o \ PDAFomi_assimilate_lenkf.o \ PDAFomi_assimilate_lenkf_si.o \ + PDAFomi_assimilate_lenkf_nondiagR.o \ + PDAFomi_assimilate_lenkf_nondiagR_si.o \ PDAF_lenkf_update.o \ PDAF_lenkf_analysis_rsm.o # Additional objects used by LEnKF but already specified for EnKF @@ -268,7 +317,19 @@ OBJ_LNETF = PDAF_lnetf_init.o \ PDAF_lnetf_update.o \ PDAF_lnetf_analysis.o \ PDAF_lnetf_smootherT.o \ - PDAF_smoother_lnetf.o + PDAF_smoother_lnetf.o \ + PDAFomi_put_state_lnetf_nondiagR.o \ + PDAFomi_put_state_lnetf_nondiagR_si.o \ + PDAFomi_assimilate_lnetf_nondiagR.o \ + PDAFomi_assimilate_lnetf_nondiagR_si.o \ + PDAFlocal_put_state_lnetf.o \ + PDAFlocal_put_state_lnetf_si.o \ + PDAFlocal_assimilate_lnetf.o \ + PDAFlocal_assimilate_lnetf_si.o \ + PDAFlocalomi_assimilate_lnetf_nondiagR.o \ + PDAFlocalomi_assimilate_lnetf_nondiagR_si.o \ + PDAFlocalomi_put_state_lnetf_nondiagR.o \ + PDAFlocalomi_put_state_lnetf_nondiagR_si.o # Specific PDAF-routines for PF OBJ_PF = PDAF_pf_init.o \ @@ -301,7 +362,19 @@ OBJ_LKNETF = PDAF_lknetf_init.o \ PDAF_lknetf_compute_gamma.o \ PDAF_lknetf_set_gamma.o \ PDAF_lknetf_alpha_neff.o \ - PDAF_lknetf_reset_gamma.o + PDAF_lknetf_reset_gamma.o \ + PDAFomi_put_state_lknetf_nondiagR.o \ + PDAFomi_put_state_lknetf_nondiagR_si.o \ + PDAFomi_assimilate_lknetf_nondiagR.o \ + PDAFomi_assimilate_lknetf_nondiagR_si.o \ + PDAFlocal_put_state_lknetf.o \ + PDAFlocal_put_state_lknetf_si.o \ + PDAFlocal_assimilate_lknetf.o \ + PDAFlocal_assimilate_lknetf_si.o \ + PDAFlocalomi_assimilate_lknetf_nondiagR.o \ + PDAFlocalomi_assimilate_lknetf_nondiagR_si.o \ + PDAFlocalomi_put_state_lknetf_nondiagR.o \ + PDAFlocalomi_put_state_lknetf_nondiagR_si.o # Specific PDAF-routines for generating observations OBJ_OBSGEN = PDAF_genobs_init.o \ @@ -355,22 +428,45 @@ OBJ_3DVAR = PDAF_put_state_3dvar.o \ PDAF_hyb3dvar_optim_cg.o \ PDAF_hyb3dvar_costf_cvt.o \ PDAF_hyb3dvar_costf_cg_cvt.o \ + PDAFlocal_put_state_en3dvar_lestkf.o \ + PDAFlocal_put_state_hyb3dvar_lestkf.o \ + PDAFlocal_assimilate_en3dvar_lestkf.o \ + PDAFlocal_assimilate_hyb3dvar_lestkf.o \ PDAFomi_assimilate_3dvar.o \ PDAFomi_assimilate_en3dvar_estkf.o \ PDAFomi_assimilate_en3dvar_lestkf.o \ PDAFomi_assimilate_hyb3dvar_estkf.o \ PDAFomi_assimilate_hyb3dvar_lestkf.o \ + PDAFomi_assimilate_3dvar_nondiagR.o \ + PDAFomi_assimilate_en3dvar_estkf_nondiagR.o \ + PDAFomi_assimilate_en3dvar_lestkf_nondiagR.o \ + PDAFomi_assimilate_hyb3dvar_estkf_nondiagR.o \ + PDAFomi_assimilate_hyb3dvar_lestkf_nondiagR.o \ + PDAFlocalomi_assimilate_en3dvar_lestkf.o \ + PDAFlocalomi_assimilate_en3dvar_lestkf_nondiagR.o \ + PDAFlocalomi_assimilate_hyb3dvar_lestkf.o \ + PDAFlocalomi_assimilate_hyb3dvar_lestkf_nondiagR.o \ PDAFomi_put_state_3dvar.o \ PDAFomi_put_state_en3dvar_estkf.o \ PDAFomi_put_state_en3dvar_lestkf.o \ PDAFomi_put_state_hyb3dvar_estkf.o \ - PDAFomi_put_state_hyb3dvar_lestkf.o + PDAFomi_put_state_hyb3dvar_lestkf.o \ + PDAFomi_put_state_3dvar_nondiagR.o \ + PDAFomi_put_state_en3dvar_estkf_nondiagR.o \ + PDAFomi_put_state_en3dvar_lestkf_nondiagR.o \ + PDAFomi_put_state_hyb3dvar_estkf_nondiagR.o \ + PDAFomi_put_state_hyb3dvar_lestkf_nondiagR.o \ + PDAFlocalomi_put_state_en3dvar_lestkf.o \ + PDAFlocalomi_put_state_en3dvar_lestkf_nondiagR.o \ + PDAFlocalomi_put_state_hyb3dvar_lestkf.o \ + PDAFlocalomi_put_state_hyb3dvar_lestkf_nondiagR.o # Additional file for 3DVar already specified in OBJ_3DVAR_ini # PDAF_3dvar_memtime.o # Routines for PDAF-OMI OBJ_PDAFOMI = PDAFomi_obs_f.o \ PDAFomi_obs_l.o \ + PDAFomi_dim_obs_l.o \ PDAFomi_obs_op.o \ PDAFomi.o \ PDAFomi_callback.o @@ -380,7 +476,10 @@ OBJ_PDAF = $(OBJ_PDAFOMI) $(OBJ_PDAF_GEN) $(OBJ_SEIK) $(OBJ_LSEIK) $(OBJ_SEEK) $(OBJ_ESTKF) $(OBJ_LESTKF) $(OBJ_LENKF) $(OBJ_NETF) $(OBJ_LNETF) \ $(OBJ_LKNETF) $(OBJ_PF) $(OBJ_OBSGEN) $(OBJ_3DVAR_INI) -OBJ_PDAF_VAR = $(OBJ_PDAF) $(OBJ_3DVAR) +OBJ_PDAF_VAR = $(OBJ_PDAF) $(OBJ_3DVAR) + +# External Routines for SANGOMA tools +OBJ_SANGOMA = ../external/SANGOMA/SANGOMA_quicksort.o # External optimizer libraries OBJ_OPTIM = ../external/CG+_mpi/cgfam.o ../external/CG+_mpi/cgsearch.o \ @@ -390,17 +489,17 @@ OBJ_OPTIM = ../external/CG+_mpi/cgfam.o ../external/CG+_mpi/cgsearch.o \ ###################################################### -../lib/libpdaf-d.a: $(MOD_PDAF) $(MOD_INTERFACE) $(OBJ_PDAF) +../lib/libpdaf-d.a: $(MOD_PDAF) $(OBJ_SANGOMA) $(MOD_INTERFACE) $(OBJ_PDAF) @echo "++++++ Generate Filter library ++++++" $(AR) -r $(AR_SPEC) $@ \ - $(MOD_PDAF) $(MOD_INTERFACE) $(OBJ_PDAF) + $(MOD_PDAF) $(MOD_INTERFACE) $(OBJ_PDAF) $(OBJ_SANGOMA) $(RANLIB) ../lib/libpdaf-d.a @cp *.mod ../include -../lib/libpdaf-var.a: $(MOD_PDAF) $(MOD_INTERFACE) $(OBJ_PDAF_VAR) $(OBJ_OPTIM) +../lib/libpdaf-var.a: $(MOD_PDAF) $(OBJ_SANGOMA) $(MOD_INTERFACE) $(OBJ_PDAF_VAR) $(OBJ_OPTIM) @echo "++++++ Generate Filter library ++++++" $(AR) -r $(AR_SPEC) $@ \ - $(MOD_PDAF) $(MOD_INTERFACE) $(OBJ_PDAF) $(OBJ_PDAF_VAR) $(OBJ_OPTIM) + $(MOD_PDAF) $(MOD_INTERFACE) $(OBJ_PDAF) $(OBJ_PDAF_VAR) $(OBJ_OPTIM) $(OBJ_SANGOMA) $(RANLIB) ../lib/libpdaf-var.a @cp *.mod ../include @@ -409,10 +508,10 @@ pdaf-var: ../lib/libpdaf-var.a .F90.o : - $(FC) $(OPT) $(MPI_INC) $(CPP_DEFS) -c $*.F90 + $(FC) $(OPT) $(MPI_INC) $(CPP_DEFS) -o $*.o -c $*.F90 .f.o : - $(FC) -O3 -o $*.o -c $*.f + $(FC) -O3 $(MPI_INC) -o $*.o -c $*.f # For older compilers one might need to separate the # preprocessing from the compilation as defined below: @@ -426,6 +525,7 @@ pdaf-var: ../lib/libpdaf-var.a clean : rm -f *.o *.mod ../lib/libpdaf-d.a ../lib/libpdaf-var.a ../include/*.mod + cd ../external/SANGOMA; rm -f *.o *.mod; cd - cd ../external/CG+; rm -f *.o; cd - cd ../external/CG+_mpi; rm -f *.o; cd - cd ../external/LBFGS; rm -f *.o; cd - diff --git a/src/PDAF_3dvar_memtime.F90 b/src/PDAF_3dvar_memtime.F90 index 3d8917576..0db4f2e09 100644 --- a/src/PDAF_3dvar_memtime.F90 +++ b/src/PDAF_3dvar_memtime.F90 @@ -45,6 +45,8 @@ SUBROUTINE PDAF_3dvar_memtime(printtype) ONLY: filterpe, mype_world, COMM_pdaf USE PDAFomi, & ONLY: omi_was_used + USE PDAFlocal, & + ONLY: pdaflocal_was_used IMPLICIT NONE @@ -157,8 +159,10 @@ SUBROUTINE PDAF_3dvar_memtime(printtype) WRITE (*, '(a, 12x, a)') 'PDAF', 'Timers in LESTKF only' WRITE (*, '(a, 14x, a, 9x, F11.3, 1x, a)') 'PDAF', 'init_n_domains_pdaf:', pdaf_time_tot(42), 's' WRITE (*, '(a, 14x, a, 13x, F11.3, 1x, a)') 'PDAF', 'init_dim_l_pdaf:', pdaf_time_tot(45), 's' - WRITE (*, '(a, 14x, a, 14x, F11.3, 1x, a)') 'PDAF', 'g2l_state_pdaf:', pdaf_time_tot(15), 's' - WRITE (*, '(a, 14x, a, 14x, F11.3, 1x, a)') 'PDAF', 'l2g_state_pdaf:', pdaf_time_tot(16), 's' + IF (.NOT.pdaflocal_was_used) THEN + WRITE (*, '(a, 14x, a, 14x, F11.3, 1x, a)') 'PDAF', 'g2l_state_pdaf:', pdaf_time_tot(15), 's' + WRITE (*, '(a, 14x, a, 14x, F11.3, 1x, a)') 'PDAF', 'l2g_state_pdaf:', pdaf_time_tot(16), 's' + END IF END IF END IF diff --git a/src/PDAF_assimilate_lknetf_si.F90 b/src/PDAF_assimilate_lknetf_si.F90 index e8859d4fa..4d00f44f4 100644 --- a/src/PDAF_assimilate_lknetf_si.F90 +++ b/src/PDAF_assimilate_lknetf_si.F90 @@ -40,7 +40,7 @@ SUBROUTINE PDAF_assimilate_lknetf_si(outflag) ! should not be changed by the user ! ! ! !REVISION HISTORY: -! 2013-08 - Lars Nerger - Initial code +! 2017-08 - Lars Nerger - Initial code ! Later revisions - see svn log ! ! !USES: diff --git a/src/PDAF_correlation_function.F90 b/src/PDAF_correlation_function.F90 new file mode 100644 index 000000000..523bc40c5 --- /dev/null +++ b/src/PDAF_correlation_function.F90 @@ -0,0 +1,127 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id: PDAF_set_comm_pdaf.F90 918 2021-12-03 07:42:19Z lnerger $ + + +!> Get value of a correlation function +!! +!! This routine returns the value of the chosen correlation +!! function according to the specified length scale. +!! +!! This is a core routine of PDAF and +!! should not be changed by the user ! +!! +!! __Revision history:__ +!! * 2024-08 - Lars Nerger - Initial code +!! * Later revisions - see repository log +!! +SUBROUTINE PDAF_correlation_function(ctype, length, distance, value) + + IMPLICIT NONE + +! *** Arguments *** + INTEGER, INTENT(in) :: ctype !< Type of correlation function + !< (1): Gaussian with f(0)=1.0 + !< (2): 5th-order polynomial (Gaspace/Cohn, 1999) + REAL, INTENT(in) :: length !< Length scale of function + !< (1): standard deviation + !< (2): support length f=0 for distance>length + REAL, INTENT(in) :: distance !< Distance at which the function is evaluated + REAL, INTENT(out) :: value !< Value of the function + + +! *** Local variables *** + REAL :: shalf ! Half of support distance for Gaspari-Cohn + + +! ************************** +! *** Set function value *** +! ************************** + + IF (ctype == 1) THEN + ! ********************************************* + ! *** Gaussian function scaled for f(0)=1.0 *** + ! ********************************************* + + ! Compute weight + IF (length > 0.0) THEN + + value = exp(-distance*distance/ (2.0*length*length)) + + ELSE + + IF (distance > 0.0) THEN + value = 0.0 + ELSE + value = 1.0 + END IF + + END IF + + ELSEIF (ctype == 2) THEN + ! ************************************************************************ + ! *** 5th-order polynomial mimicking Gaussian but with compact support *** + ! *** Equation (4.10) of Gaspari&Cohn, QJRMS125, 723 (1999) *** + ! ************************************************************************ + + shalf = REAL(length) / 2.0 + + ! Evaluate function + cradnull: IF (length > 0.0) THEN + + cutoff: IF (distance <= length) THEN + IF (distance <= length / 2.0) THEN + value = -0.25 * (distance / shalf)**5 & + + 0.5 * (distance / shalf)**4 & + + 5.0 / 8.0 * (distance / shalf)**3 & + - 5.0 / 3.0 * (distance / shalf)**2 + 1.0 + ELSEIF (distance > length / 2.0 .AND. distance < length * 0.9) THEN + value = 1.0 / 12.0 * (distance / shalf)**5 & + - 0.5 * (distance / shalf)**4 & + + 5.0 / 8.0 * (distance / shalf)**3 & + + 5.0 / 3.0 * (distance / shalf)**2 & + - 5.0 * (distance / shalf) & + + 4.0 - 2.0 / 3.0 * shalf / distance + ELSEIF (distance >= length * 0.9 .AND. distance < length) THEN + value = MAX(1.0 / 12.0 * (distance / shalf)**5 & + - 0.5 * (distance / shalf)**4 & + + 5.0 / 8.0 * (distance / shalf)**3 & + + 5.0 / 3.0 * (distance / shalf)**2 & + - 5.0 * (distance / shalf) & + + 4.0 - 2.0 / 3.0 * shalf / distance, 0.0) + ELSE + value = 0.0 + ENDIF + ELSE cutoff + value = 0.0 + END IF cutoff + + ELSE cradnull + + IF (distance > 0.0) THEN + value = 0.0 + ELSE + value = 1.0 + END IF + + END IF cradnull + + END IF + + +END SUBROUTINE PDAF_correlation_function diff --git a/src/PDAF_diag_crps.F90 b/src/PDAF_diag_crps.F90 index dffef5493..0398cb85d 100644 --- a/src/PDAF_diag_crps.F90 +++ b/src/PDAF_diag_crps.F90 @@ -1,4 +1,4 @@ -! Copyright (c) 2012-2024 Lars Nerger, lars.nerger@awi.de +! Copyright (c) 2012-2023 Lars Nerger, lars.nerger@awi.de ! ! This routine is free software: you can redistribute it and/or modify ! it under the terms of the GNU Lesser General Public License @@ -19,19 +19,254 @@ !! !! This routine computes the continuous ranked probability !! score (CRPS) and its decomposition into uncertainty and -!! resolution: CRPS = RELI + RESOL. In addition the uncertainty +!! potential CRPS: CRPS = RELI + pot_CRPS. In addition the uncertainty !! is computed. +!! Resolution can be computed by RESOL = UNCERT - pot_CRPS. !! A perfectly reliable system gives RELI=0. -!! An informative system gives RESOL << UNCERT. +!! An informative system gives RESOL ~ UNCERT or pot_CRPS << UNCERT. !! !! The computation follows H. Hersbach, Weather and Forecasting -!! 15(2000) 599-570. Here, RESOL is equivalent to CPRS_pot. +!! 15(2000) 599-570. !! !! __Revision history:__ !! * 2021-05 - Lars Nerger - Initial code based on sangoma_ComputeCRPS !! * Later revisions - see repository log +!! * 2024-04 - Yumeng Chen - refactor; add domain decomposition support !! -SUBROUTINE PDAF_diag_CRPS(dim, dim_ens, element, oens, obs, & + +!--------------------------------------------------------------------------- +!> CRPS diagnostic routine with original interface +!! +SUBROUTINE PDAF_diag_crps(dim_p, dim_ens, element, oens, obs, & + CRPS, reli, pot_CRPS, uncert, status)! +#include "typedefs.h" + + USE mpi + USE PDAF_mod_filtermpi, & + ONLY: COMM_filter, mype_filter, npes_filter + USE SANGOMA_quicksort + + IMPLICIT NONE + + ! *** Arguments *** + INTEGER, INTENT(in) :: dim_p !< PE-local state dimension + INTEGER, INTENT(in) :: dim_ens !< Ensemble size + INTEGER, INTENT(in) :: element !< index of element in full state vector + !< If element=0, mean values over dim_p grid points/cases are computed + REAL, INTENT(in) :: oens(dim_p, dim_ens) !< State ensemble + REAL, INTENT(in) :: obs(dim_p) !< Observation / truth + REAL, INTENT(out) :: CRPS !< CRPS + REAL, INTENT(out) :: reli !< Reliability + REAL, INTENT(out) :: pot_CRPS !< potential CRPS + REAL, INTENT(out) :: uncert !< uncertainty + INTEGER, INTENT(out) :: status !< Status flag (0=success) + + CALL PDAF_diag_crps_mpi(dim_p, dim_ens, element, oens, obs, & + COMM_filter, mype_filter, npes_filter, & + CRPS, reli, pot_CRPS, uncert, status)! + +END SUBROUTINE PDAF_diag_crps + +!--------------------------------------------------------------------------- +!> CRPS diagnostic routine including MPI-settings in interface +!! +SUBROUTINE PDAF_diag_crps_mpi(dim_p, dim_ens, element, oens, obs, & + COMM_filter, mype_filter, npes_filter, & + CRPS, reli, pot_CRPS, uncert, status) +#include "typedefs.h" + + USE mpi + USE SANGOMA_quicksort + + IMPLICIT NONE + + ! *** Arguments *** + INTEGER, INTENT(in) :: dim_p !< PE-local state dimension + INTEGER, INTENT(in) :: dim_ens !< Ensemble size + INTEGER, INTENT(in) :: element !< index of element in full state vector + !< If element=0, mean values over dim_p grid points/cases are computed + INTEGER, INTENT(in) :: COMM_filter !< MPI communicator for filter + INTEGER, INTENT(in) :: mype_filter !< rank of MPI communicator + INTEGER, INTENT(in) :: npes_filter !< size of MPI communicator + REAL, INTENT(in) :: oens(dim_p, dim_ens) !< State ensemble + REAL, INTENT(in) :: obs(dim_p) !< Observation / truth + REAL, INTENT(out) :: CRPS !< CRPS + REAL, INTENT(out) :: reli !< Reliability + REAL, INTENT(out) :: pot_CRPS !< potential CRPS + REAL, INTENT(out) :: uncert !< uncertainty + INTEGER, INTENT(out) :: status !< Status flag (0=success) + + ! *** local variables *** + INTEGER :: i, k ! counter + INTEGER :: istart ! starting index of grid point/case + INTEGER :: imax ! end index of grid point/case + INTEGER :: dim ! dimension of the full state vector + INTEGER :: MPIerr + REAL :: wk ! weight for each grid point/case + REAL :: x_a ! truth / verifying analysis (observation) + REAL :: gi ! The difference between i+1-th ensemble member and i-th member + REAL :: oi + REAL :: o0, one_minus_oN + REAL :: o0_p, one_minus_oN_p + REAL :: pval + INTEGER, ALLOCATABLE :: all_dim_p(:) ! dimensions of the local state vector + INTEGER, ALLOCATABLE :: dis_dim_p(:) ! dimensions of the local state vector + REAL, ALLOCATABLE :: one_case(:) ! ensemble in each case, this is variable x in H. Hersbach (2000) + REAL, ALLOCATABLE :: allobs(:) + REAL, ALLOCATABLE :: alpha_p(:), beta_p(:) + REAL, ALLOCATABLE :: alpha(:), beta(:) + + ! initialise the status flag + status = 0 + + ! initialise crps output + crps = 0.0 + reli = 0.0 + pot_CRPS = 0.0 + uncert = 0.0 + + ! allocate arrays for MPI communication + ALLOCATE( all_dim_p(npes_filter), dis_dim_p(npes_filter) ) + ! gather the dimension of the local state vector to all_dim_p + CALL MPI_Allgather(dim_p, 1, MPI_INTEGER, all_dim_p, 1, MPI_INTEGER, COMM_filter, MPIerr) + ! displacement of the received array used for gatherv + dis_dim_p(1) = 0 + DO i = 2, npes_filter + dis_dim_p(i) = dis_dim_p(i - 1) + all_dim_p(i - 1) + END DO + + ! dimension fo the full state vector + dim = SUM(all_dim_p) + + ! Set number of element over which CPRS is computed + IF (element==0) THEN + istart = 1 + imax = dim_p + ! weight for each grid point/case + wk = 1.0/REAL(dim) + ELSEIF (element<=dim) THEN + ! error handling + IF (element < 0) THEN + status = 100 + WRITE(*, '(a, 5x, a, I4, a)') 'PDAF warning:', & + 'PDAF_diag_crps: element(', element, ') argument must be >= 0.' + RETURN + ENDIF + ! + IF (element <= dis_dim_p(mype_filter + 1) .OR. element > dis_dim_p(mype_filter + 1) + dim_p) THEN + istart = 1 + imax = 0 + ELSE + ! index for + istart = element - dis_dim_p(mype_filter + 1) + imax = istart + wk = 1.0 + END IF + ELSE + istart = 1 + imax = 0 + status = 100 + wk = 1.0 + WRITE(*, '(a, 5x, a, I4, a, I4, a)') 'PDAF warning:', & + 'PDAF_diag_crps: element (', element, ') argument must be <= dim_p (', dim_p, ').' + RETURN + END IF + + ! Calculate uncertainty based on Eq 20 in H. Hersbach (2000) + ! Uncertainty is only meaningful when multiple verifying analysis exists + ! because it is calculated based on the distribution of observations + IF (element == 0) THEN + ALLOCATE( allobs(dim), source=0. ) + ! get observations across PEs + CALL MPI_Allgatherv(obs, dim_p, MPI_REALTYPE, allobs, all_dim_p, dis_dim_p, MPI_REALTYPE, COMM_filter, MPIerr) + CALL quicksort_d(allobs, dim) + pval = 0. + DO k = 1, dim - 1 + pval = pval + wk + uncert = uncert + (allobs(k+1) - allobs(k)) * pval*(1.0-pval) + END DO + DEALLOCATE(allobs) + END IF + + ! allocate arrays for CRPS calculation + ALLOCATE(one_case(dim_ens)) + ALLOCATE(alpha_p(0:dim_ens), source=0.) + ALLOCATE(beta_p(0:dim_ens), source=0.) + + ! initialise values used for summation in the loop + one_minus_oN_p = 0. + o0_p = 0. + + ! Loop over grid points/cases + DO k = istart, imax + ! Get observation for current case + x_a = obs(k) + + ! Get sorted ensemble for current case + DO i = 1, dim_ens + one_case(i) = oens(k, i) + END DO + CALL quicksort_d(one_case, dim_ens) + + ! Outlier cases + IF (x_a < one_case(1)) THEN + ! Case 1: obs < all ensemble members + beta_p(0) = beta_p(0) + wk*(one_case(1) - x_a) + o0_p = o0_p + wk + ELSEIF (x_a > one_case(dim_ens)) THEN + ! Case 2: obs > all ensemble members + alpha_p(dim_ens) = alpha_p(dim_ens) + wk*(x_a - one_case(dim_ens)) + one_minus_oN_p = one_minus_oN_p + wk + END IF + + ! Eq. 29 and Eq. 26 in H. Hersbach (2000) + DO i = 1, dim_ens-1 + alpha_p(i) = alpha_p(i) + wk*MAX( MIN(x_a, one_case(i+1)) - one_case(i), 0.0) + beta_p(i) = beta_p(i) + wk*MAX(one_case(i+1) - MAX(x_a, one_case(i)), 0.0) + END DO + END DO + + ALLOCATE(alpha(0:dim_ens), source=0.) + ALLOCATE(beta(0:dim_ens), source=0.) + ! todo: get full alpha and beta + CALL MPI_Allreduce(alpha_p, alpha, dim_ens, MPI_REALTYPE, MPI_SUM, COMM_filter, MPIerr) + CALL MPI_Allreduce(beta_p, beta, dim_ens, MPI_REALTYPE, MPI_SUM, COMM_filter, MPIerr) + CALL MPI_Allreduce(one_minus_oN_p, one_minus_oN, 1, MPI_REALTYPE, MPI_SUM, COMM_filter, MPIerr) + CALL MPI_Allreduce(o0_p, o0, 1, MPI_REALTYPE, MPI_SUM, COMM_filter, MPIerr) + DEALLOCATE(one_case, alpha_p, beta_p) + + ! Complete computation of CPRS, reliability and potential CPRS + ! modify alpha(0) and beta(dim_ens) to accomodate outliers calculation + ! This is equivalent to Eq. 33 in H. Hersbach (2000) + IF (alpha(0) /= 0.0) alpha(0) = beta(0) * (1.0/o0 - 1.0) + IF (beta(dim_ens) /= 0.0) beta(dim_ens) = alpha(dim_ens) * (1.0/one_minus_oN - 1.0) + + DO i = 0, dim_ens + ! The difference between i+1-th ensemble member and i-th member + gi = alpha(i) + beta(i) + IF (gi /= 0.0) THEN + oi = beta(i) / gi + ELSE + oi = 0.0 + END IF + pval = REAL(i) / REAL(dim_ens) + + crps = crps + alpha(i)*pval*pval + beta(i)*(1.0-pval)*(1.0-pval) + reli = reli + gi * (oi - pval)*(oi - pval) + pot_CRPS = pot_CRPS + gi * oi * (1.0-oi) + END DO + + ! **************** + ! *** Clean up *** + ! **************** + DEALLOCATE(alpha, beta) + +END SUBROUTINE PDAF_diag_crps_mpi + +!-------------------------------------------------------- +!> CRPS routine from PDAF until V2.2.1 without parallelization +!! +SUBROUTINE PDAF_diag_CRPS_nompi(dim, dim_ens, element, oens, obs, & CRPS, reli, resol, uncert, status)! IMPLICIT NONE @@ -60,6 +295,14 @@ SUBROUTINE PDAF_diag_CRPS(dim, dim_ens, element, oens, obs, & REAL, ALLOCATABLE :: c_a(:), c_b(:) +! ****************** +! *** Initialize *** +! ****************** + + ! Initialize status flag + status = 0 + + ! ******************** ! *** Compute CRPS *** ! ******************** @@ -139,7 +382,7 @@ SUBROUTINE PDAF_diag_CRPS(dim, dim_ens, element, oens, obs, & resol = 0.0 oi = 0.0 - DO i = 1, dim_ens + DO i = 0, dim_ens gi = c_a(i) + c_b(i) IF (gi /= 0.0) THEN oi = c_a(i) / gi @@ -168,7 +411,7 @@ SUBROUTINE PDAF_diag_CRPS(dim, dim_ens, element, oens, obs, & DEALLOCATE(oneens, c_a, c_b) -END SUBROUTINE PDAF_diag_CRPS +END SUBROUTINE PDAF_diag_CRPS_nompi !-------------------------------------------------------- @@ -192,24 +435,24 @@ SUBROUTINE PDAF_sisort(n, veca) DO j = 2, n - eflag = .FALSE. + eflag = .FALSE. - tmpa = veca(j) + tmpa = veca(j) - sortloop: DO i = j-1, 1, -1 - k = i + sortloop: DO i = j-1, 1, -1 + k = i - IF(veca(i) <= tmpa) THEN - eflag = .TRUE. - EXIT sortloop - END IF + IF(veca(i) <= tmpa) THEN + eflag = .TRUE. + EXIT sortloop + END IF - veca(i+1) = veca(i) - ENDDO sortloop + veca(i+1) = veca(i) + ENDDO sortloop - IF (.NOT.eflag) k=0 + IF (.NOT.eflag) k=0 - veca(k+1) = tmpa + veca(k+1) = tmpa ENDDO diff --git a/src/PDAF_estkf_analysis.F90 b/src/PDAF_estkf_analysis.F90 index 789e9d381..531b0be74 100644 --- a/src/PDAF_estkf_analysis.F90 +++ b/src/PDAF_estkf_analysis.F90 @@ -293,6 +293,34 @@ SUBROUTINE PDAF_estkf_analysis(step, dim_p, dim_obs_p, dim_ens, rank, & CALL PDAF_timeit(51, 'old') END IF + ELSE IF (dim_obs_p == 0) THEN + + ! For OMI we need to call observation operator also for dim_obs_p=0 + ! in order to initialize the pointer to the observation types + ! Further the observation operator has to be executed in cases + ! in which the operation include a global communication + IF (.NOT.observe_ens) THEN + IF (omi_n_obstypes>0) THEN + ALLOCATE(HXbar_p(1)) + obs_member = 0 + + ! [Hx_1 ... Hx_N] + CALL U_obs_op(step, dim_p, dim_obs_p, state_p, HXbar_p) + + DEALLOCATE(HXbar_p) + ELSE + ALLOCATE(HL_p(1,1)) + DO member = 1, dim_ens + ! Store member index to make it accessible with PDAF_get_obsmemberid + obs_member = member + + ! [Hx_1 ... Hx_N] + CALL U_obs_op(step, dim_p, dim_obs_p, ens_p(:, member), HL_p(:, member)) + END DO + DEALLOCATE(HL_p) + END IF + END IF + END IF haveobsB CALL PDAF_timeit(12, 'old') @@ -411,14 +439,20 @@ SUBROUTINE PDAF_estkf_analysis(step, dim_p, dim_obs_p, dim_ens, rank, & ! For OMI we need to call observation operator also for dim_obs_p=0 ! in order to initialize the pointer to the observation types + ! Further the observation operator has to be executed in cases + ! in which the operation includes a global communication IF (omi_n_obstypes>0) THEN - ALLOCATE(HL_p(1, 1)) - obs_member = 1 - - ! [Hx_1 ... Hx_N] - CALL U_obs_op(step, dim_p, dim_obs_p, ens_p(:, 1), HL_p(:, 1)) - - DEALLOCATE(HL_p) + IF (.NOT.observe_ens) THEN + ALLOCATE(HL_p(1,1)) + DO member = 1, dim_ens + ! Store member index to make it accessible with PDAF_get_obsmemberid + obs_member = member + + ! [Hx_1 ... Hx_N] + CALL U_obs_op(step, dim_p, dim_obs_p, ens_p(:, member), HL_p(:, member)) + END DO + DEALLOCATE(HL_p) + END IF END IF END IF haveobsA @@ -731,7 +765,7 @@ SUBROUTINE PDAF_estkf_analysis(step, dim_p, dim_obs_p, dim_ens, rank, & CALL PDAF_timeit(34, 'new') IF (type_sqrt == 1) THEN ! A = (Omega C^(-1)) by solving Ct A = OmegaT for A - CALL trtrsTYPE('l', 't', 'n', rank, dim_ens, & + CALL trtrsTYPE('L', 'T', 'N', rank, dim_ens, & tmp_Ainv, rank, OmegaT, rank, lib_info) ELSE ! TMP_AINV already contains matrix C (no more inversion) diff --git a/src/PDAF_estkf_analysis_fixed.F90 b/src/PDAF_estkf_analysis_fixed.F90 index 9cebb60f7..c5534f324 100644 --- a/src/PDAF_estkf_analysis_fixed.F90 +++ b/src/PDAF_estkf_analysis_fixed.F90 @@ -268,6 +268,34 @@ SUBROUTINE PDAF_estkf_analysis_fixed(step, dim_p, dim_obs_p, dim_ens, rank, & CALL PDAF_timeit(51, 'old') END IF + ELSE IF (dim_obs_p == 0) THEN + + ! For OMI we need to call observation operator also for dim_obs_p=0 + ! in order to initialize the pointer to the observation types + ! Further the observation operator has to be executed in cases + ! in which the operation include a global communication + IF (.NOT.observe_ens) THEN + IF (omi_n_obstypes>0) THEN + ALLOCATE(HXbar_p(1)) + obs_member = 0 + + ! [Hx_1 ... Hx_N] + CALL U_obs_op(step, dim_p, dim_obs_p, state_p, HXbar_p) + + DEALLOCATE(HXbar_p) + ELSE + ALLOCATE(HL_p(1,1)) + DO member = 1, dim_ens + ! Store member index to make it accessible with PDAF_get_obsmemberid + obs_member = member + + ! [Hx_1 ... Hx_N] + CALL U_obs_op(step, dim_p, dim_obs_p, ens_p(:, member), HL_p(:, member)) + END DO + DEALLOCATE(HL_p) + END IF + END IF + END IF haveobsB CALL PDAF_timeit(12, 'old') @@ -385,15 +413,21 @@ SUBROUTINE PDAF_estkf_analysis_fixed(step, dim_p, dim_obs_p, dim_ens, rank, & Ainv_p = 0.0 ! For OMI we need to call observation operator also for dim_obs_p=0 - ! in order to initialize pointer to observation type + ! in order to initialize the pointer to the observation types + ! Further the observation operator has to be executed in cases + ! in which the operation includes a global communication IF (omi_n_obstypes>0) THEN - ALLOCATE(HL_p(1, 1)) - obs_member = 1 - - ! [Hx_1 ... Hx_N] - CALL U_obs_op(step, dim_p, dim_obs_p, ens_p(:, 1), HL_p(:, 1)) - - DEALLOCATE(HL_p) + IF (.NOT.observe_ens) THEN + ALLOCATE(HL_p(1,1)) + DO member = 1, dim_ens + ! Store member index to make it accessible with PDAF_get_obsmemberid + obs_member = member + + ! [Hx_1 ... Hx_N] + CALL U_obs_op(step, dim_p, dim_obs_p, ens_p(:, member), HL_p(:, member)) + END DO + DEALLOCATE(HL_p) + END IF END IF END IF haveobsA diff --git a/src/PDAF_etkf_analysis.F90 b/src/PDAF_etkf_analysis.F90 index 681f27759..f0be4c4fc 100644 --- a/src/PDAF_etkf_analysis.F90 +++ b/src/PDAF_etkf_analysis.F90 @@ -272,6 +272,34 @@ SUBROUTINE PDAF_etkf_analysis(step, dim_p, dim_obs_p, dim_ens, & CALL PDAF_timeit(51, 'old') END IF + ELSE IF (dim_obs_p == 0) THEN + + ! For OMI we need to call observation operator also for dim_obs_p=0 + ! in order to initialize the pointer to the observation types + ! Further the observation operator has to be executed in cases + ! in which the operation include a global communication + IF (.NOT.observe_ens) THEN + IF (omi_n_obstypes>0) THEN + ALLOCATE(HXbar_p(1)) + obs_member = 0 + + ! [Hx_1 ... Hx_N] + CALL U_obs_op(step, dim_p, dim_obs_p, state_p, HXbar_p) + + DEALLOCATE(HXbar_p) + ELSE + ALLOCATE(HZ_p(1,1)) + DO member = 1, dim_ens + ! Store member index to make it accessible with PDAF_get_obsmemberid + obs_member = member + + ! [Hx_1 ... Hx_N] + CALL U_obs_op(step, dim_p, dim_obs_p, ens_p(:, member), HZ_p(:, member)) + END DO + DEALLOCATE(HZ_p) + END IF + END IF + END IF haveobsB CALL PDAF_timeit(12, 'old') @@ -384,15 +412,21 @@ SUBROUTINE PDAF_etkf_analysis(step, dim_p, dim_obs_p, dim_ens, & Usqrt = 0.0 ! For OMI we need to call observation operator also for dim_obs_p=0 - ! in order to initialize pointer to observation type + ! in order to initialize the pointer to the observation types + ! Further the observation operator has to be executed in cases + ! in which the operation includes a global communication IF (omi_n_obstypes>0) THEN - ALLOCATE(HZ_p(1, 1)) - obs_member = 1 - - ! [Hx_1 ... Hx_N] - CALL U_obs_op(step, dim_p, dim_obs_p, ens_p(:, 1), HZ_p(:, 1)) - - DEALLOCATE(HZ_p) + IF (.NOT.observe_ens) THEN + ALLOCATE(HZ_p(1,1)) + DO member = 1, dim_ens + ! Store member index to make it accessible with PDAF_get_obsmemberid + obs_member = member + + ! [Hx_1 ... Hx_N] + CALL U_obs_op(step, dim_p, dim_obs_p, ens_p(:, member), HZ_p(:, member)) + END DO + DEALLOCATE(HZ_p) + END IF END IF END IF haveobsA diff --git a/src/PDAF_etkf_analysis_T.F90 b/src/PDAF_etkf_analysis_T.F90 index c13573690..889ae50bd 100644 --- a/src/PDAF_etkf_analysis_T.F90 +++ b/src/PDAF_etkf_analysis_T.F90 @@ -274,6 +274,33 @@ SUBROUTINE PDAF_etkf_analysis_T(step, dim_p, dim_obs_p, dim_ens, & CALL PDAF_timeit(51, 'old') END IF + ELSE IF (dim_obs_p == 0) THEN + + ! For OMI we need to call observation operator also for dim_obs_p=0 + ! in order to initialize the pointer to the observation types + ! Further the observation operator has to be executed in cases + ! in which the operation include a global communication + IF (.NOT.observe_ens) THEN + IF (omi_n_obstypes>0) THEN + ALLOCATE(HXbar_p(1)) + obs_member = 0 + + ! [Hx_1 ... Hx_N] + CALL U_obs_op(step, dim_p, dim_obs_p, state_p, HXbar_p) + + DEALLOCATE(HXbar_p) + ELSE + ALLOCATE(HZ_p(1,1)) + DO member = 1, dim_ens + ! Store member index to make it accessible with PDAF_get_obsmemberid + obs_member = member + + ! [Hx_1 ... Hx_N] + CALL U_obs_op(step, dim_p, dim_obs_p, ens_p(:, member), HZ_p(:, member)) + END DO + DEALLOCATE(HZ_p) + END IF + END IF END IF haveobsB CALL PDAF_timeit(12, 'old') @@ -386,15 +413,21 @@ SUBROUTINE PDAF_etkf_analysis_T(step, dim_p, dim_obs_p, dim_ens, & Asqrt = 0.0 ! For OMI we need to call observation operator also for dim_obs_p=0 - ! in order to initialize pointer to observation type + ! in order to initialize the pointer to the observation types + ! Further the observation operator has to be executed in cases + ! in which the operation includes a global communication IF (omi_n_obstypes>0) THEN - ALLOCATE(HZ_p(1, 1)) - obs_member = 1 - - ! [Hx_1 ... Hx_N] - CALL U_obs_op(step, dim_p, dim_obs_p, ens_p(:, 1), HZ_p(:, 1)) - - DEALLOCATE(HZ_p) + IF (.NOT.observe_ens) THEN + ALLOCATE(HZ_p(1,1)) + DO member = 1, dim_ens + ! Store member index to make it accessible with PDAF_get_obsmemberid + obs_member = member + + ! [Hx_1 ... Hx_N] + CALL U_obs_op(step, dim_p, dim_obs_p, ens_p(:, member), HZ_p(:, member)) + END DO + DEALLOCATE(HZ_p) + END IF END IF END IF haveobsA diff --git a/src/PDAF_etkf_analysis_fixed.F90 b/src/PDAF_etkf_analysis_fixed.F90 index 2e7bdf934..cc530e0da 100644 --- a/src/PDAF_etkf_analysis_fixed.F90 +++ b/src/PDAF_etkf_analysis_fixed.F90 @@ -261,6 +261,34 @@ SUBROUTINE PDAF_etkf_analysis_fixed(step, dim_p, dim_obs_p, dim_ens, & CALL PDAF_timeit(51, 'old') END IF + ELSE IF (dim_obs_p == 0) THEN + + ! For OMI we need to call observation operator also for dim_obs_p=0 + ! in order to initialize the pointer to the observation types + ! Further the observation operator has to be executed in cases + ! in which the operation include a global communication + IF (.NOT.observe_ens) THEN + IF (omi_n_obstypes>0) THEN + ALLOCATE(HXbar_p(1)) + obs_member = 0 + + ! [Hx_1 ... Hx_N] + CALL U_obs_op(step, dim_p, dim_obs_p, state_p, HXbar_p) + + DEALLOCATE(HXbar_p) + ELSE + ALLOCATE(HZ_p(1,1)) + DO member = 1, dim_ens + ! Store member index to make it accessible with PDAF_get_obsmemberid + obs_member = member + + ! [Hx_1 ... Hx_N] + CALL U_obs_op(step, dim_p, dim_obs_p, ens_p(:, member), HZ_p(:, member)) + END DO + DEALLOCATE(HZ_p) + END IF + END IF + END IF haveobsB CALL PDAF_timeit(12, 'old') @@ -373,15 +401,21 @@ SUBROUTINE PDAF_etkf_analysis_fixed(step, dim_p, dim_obs_p, dim_ens, & Asqrt = 0.0 ! For OMI we need to call observation operator also for dim_obs_p=0 - ! in order to initialize pointer to observation type + ! in order to initialize the pointer to the observation types + ! Further the observation operator has to be executed in cases + ! in which the operation includes a global communication IF (omi_n_obstypes>0) THEN - ALLOCATE(HZ_p(1, 1)) - obs_member = 1 - - ! [Hx_1 ... Hx_N] - CALL U_obs_op(step, dim_p, dim_obs_p, ens_p(:, 1), HZ_p(:, 1)) - - DEALLOCATE(HZ_p) + IF (.NOT.observe_ens) THEN + ALLOCATE(HZ_p(1,1)) + DO member = 1, dim_ens + ! Store member index to make it accessible with PDAF_get_obsmemberid + obs_member = member + + ! [Hx_1 ... Hx_N] + CALL U_obs_op(step, dim_p, dim_obs_p, ens_p(:, member), HZ_p(:, member)) + END DO + DEALLOCATE(HZ_p) + END IF END IF END IF haveobsA diff --git a/src/PDAF_interfaces_module.F90 b/src/PDAF_interfaces_module.F90 index 6a329a53d..68a685966 100644 --- a/src/PDAF_interfaces_module.F90 +++ b/src/PDAF_interfaces_module.F90 @@ -40,6 +40,8 @@ MODULE PDAF_interfaces_module ! (Defines BLAS/LAPACK routines and MPI_REALTYPE) #include "typedefs.h" + USE PDAFlocal_interfaces + INTERFACE SUBROUTINE PDAF_init(filtertype, subtype, stepnull, param_int, dim_pint, & param_real, dim_preal, COMM_model, COMM_filter, COMM_couple, & @@ -590,12 +592,7 @@ SUBROUTINE PDAF_put_state_lnetf(U_collect_state, U_init_dim_obs, U_obs_op, & U_init_obs_l, U_prepoststep, U_likelihood_l, U_init_n_domains_p, & U_init_dim_l, U_init_dim_obs_l, U_g2l_state, U_l2g_state, U_g2l_obs, & outflag) - -! !ARGUMENTS: INTEGER, INTENT(out) :: outflag ! Status flag - -! ! External subroutines -! ! (PDAF-internal names, real names are defined in the call to PDAF) EXTERNAL :: U_collect_state, & ! Routine to collect a state vector U_obs_op, & ! Observation operator U_init_n_domains_p, & ! Provide number of local analysis domains @@ -653,12 +650,7 @@ SUBROUTINE PDAF_put_state_lknetf(U_collect_state, U_init_dim_obs, U_obs_op, & U_init_n_domains_p, & U_init_dim_l, U_init_dim_obs_l, U_g2l_state, U_l2g_state, U_g2l_obs, & U_init_obsvar, U_init_obsvar_l, U_likelihood_l, U_likelihood_hyb_l, outflag) - -! !ARGUMENTS: INTEGER, INTENT(out) :: outflag ! Status flag - -! ! External subroutines -! ! (PDAF-internal names, real names are defined in the call to PDAF) EXTERNAL :: U_collect_state, & ! Routine to collect a state vector U_obs_op, & ! Observation operator U_init_n_domains_p, & ! Provide number of local analysis domains @@ -1050,6 +1042,63 @@ SUBROUTINE PDAF_diag_effsample(dim_sample, weights, effSample) END SUBROUTINE PDAF_diag_effsample END INTERFACE + INTERFACE + SUBROUTINE PDAF_diag_crps(dim_p, dim_ens, element, oens, obs, & + CRPS, reli, pot_CRPS, uncert, status)! + IMPLICIT NONE + INTEGER, INTENT(in) :: dim_p !< PE-local state dimension + INTEGER, INTENT(in) :: dim_ens !< Ensemble size + INTEGER, INTENT(in) :: element !< index of element in full state vector + !< If element=0, mean values over dim_p grid points/cases are computed + REAL, INTENT(in) :: oens(dim_p, dim_ens) !< State ensemble + REAL, INTENT(in) :: obs(dim_p) !< Observation / truth + REAL, INTENT(out) :: CRPS !< CRPS + REAL, INTENT(out) :: reli !< Reliability + REAL, INTENT(out) :: pot_CRPS !< potential CRPS + REAL, INTENT(out) :: uncert !< uncertainty + INTEGER, INTENT(out) :: status !< Status flag (0=success) + END SUBROUTINE PDAF_diag_crps + END INTERFACE + + INTERFACE + SUBROUTINE PDAF_diag_crps_mpi(dim_p, dim_ens, element, oens, obs, & + COMM_filter, mype_filter, npes_filter, & + CRPS, reli, pot_CRPS, uncert, status) + IMPLICIT NONE + INTEGER, INTENT(in) :: dim_p !< PE-local state dimension + INTEGER, INTENT(in) :: dim_ens !< Ensemble size + INTEGER, INTENT(in) :: element !< index of element in full state vector + !< If element=0, mean values over dim_p grid points/cases are computed + INTEGER, INTENT(in) :: COMM_filter !< MPI communicator for filter + INTEGER, INTENT(in) :: mype_filter !< rank of MPI communicator + INTEGER, INTENT(in) :: npes_filter !< size of MPI communicator + REAL, INTENT(in) :: oens(dim_p, dim_ens) !< State ensemble + REAL, INTENT(in) :: obs(dim_p) !< Observation / truth + REAL, INTENT(out) :: CRPS !< CRPS + REAL, INTENT(out) :: reli !< Reliability + REAL, INTENT(out) :: pot_CRPS !< potential CRPS + REAL, INTENT(out) :: uncert !< uncertainty + INTEGER, INTENT(out) :: status !< Status flag (0=success) + END SUBROUTINE PDAF_diag_crps_mpi + END INTERFACE + + INTERFACE + SUBROUTINE PDAF_diag_CRPS_nompi(dim, dim_ens, element, oens, obs, & + CRPS, reli, resol, uncert, status)! + IMPLICIT NONE + INTEGER, INTENT(in) :: dim !< PE-local state dimension + INTEGER, INTENT(in) :: dim_ens !< Ensemble size + INTEGER, INTENT(in) :: element !< ID of element to be used + !< If element=0, mean values over all elements are computed + REAL, INTENT(in) :: oens(dim, dim_ens) !< State ensemble + REAL, INTENT(in) :: obs(dim) !< State ensemble + REAL, INTENT(out) :: CRPS !< CRPS + REAL, INTENT(out) :: reli !< Reliability + REAL, INTENT(out) :: resol !< resolution + REAL, INTENT(out) :: uncert !< uncertainty + INTEGER, INTENT(out) :: status !< Status flag (0=success) + END SUBROUTINE PDAF_diag_CRPS_nompi + END INTERFACE INTERFACE SUBROUTINE PDAF_gather_obs_f(obs_p, obs_f, status) @@ -1092,345 +1141,186 @@ SUBROUTINE PDAF_get_localfilter(lfilter) END SUBROUTINE PDAF_get_localfilter END INTERFACE -! OMI INTERFACES --------------------- - INTERFACE - SUBROUTINE PDAFomi_put_state_global(U_collect_state, U_init_dim_obs, U_obs_op, & - U_prepoststep, flag) - INTEGER, INTENT(out) :: flag ! Status flag + SUBROUTINE PDAF_put_state_3dvar(U_collect_state, & + U_init_dim_obs, U_obs_op, U_init_obs, U_prodRinvA, & + U_cvt, U_cvt_adj, U_obs_op_lin, U_obs_op_adj, & + U_prepoststep, outflag) + INTEGER, INTENT(out) :: outflag ! Status flag EXTERNAL :: U_collect_state, & ! Routine to collect a state vector - U_init_dim_obs, & ! Initialize dimension of observation vector - U_obs_op, & ! Observation operator - U_prepoststep ! User supplied pre/poststep routine - END SUBROUTINE PDAFomi_put_state_global - END INTERFACE - - INTERFACE - SUBROUTINE PDAFomi_assimilate_global(U_collect_state, U_distribute_state, & - U_init_dim_obs, U_obs_op, U_prepoststep, U_next_observation, flag) - INTEGER, INTENT(out) :: flag ! Status flag - EXTERNAL :: U_collect_state, & ! Routine to collect a state vector - U_distribute_state, & ! Routine to distribute a state vector - U_init_dim_obs, & ! Initialize dimension of observation vector - U_obs_op, & ! Observation operator - U_prepoststep, & ! User supplied pre/poststep routine - U_next_observation ! Provide time step and time of next observation - END SUBROUTINE PDAFomi_assimilate_global - END INTERFACE - - INTERFACE - SUBROUTINE PDAFomi_put_state_local(U_collect_state, U_init_dim_obs, U_obs_op, & - U_prepoststep, U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, & - U_g2l_state, U_l2g_state, flag) - INTEGER, INTENT(out) :: flag ! Status flag - EXTERNAL :: U_collect_state, & ! Routine to collect a state vector - U_obs_op, & ! Observation operator - U_init_n_domains_p, & ! Provide number of local analysis domains - U_init_dim_l, & ! Init state dimension for local ana. domain - U_init_dim_obs, & ! Initialize dimension of observation vector - U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain - U_g2l_state, & ! Get state on local ana. domain from full state - U_l2g_state, & ! Init full state from state on local analysis domain - U_prepoststep ! User supplied pre/poststep routine - END SUBROUTINE PDAFomi_put_state_local - END INTERFACE - - INTERFACE - SUBROUTINE PDAFomi_assimilate_local(U_collect_state, U_distribute_state, & - U_init_dim_obs, U_obs_op, U_prepoststep, U_init_n_domains_p, U_init_dim_l, & - U_init_dim_obs_l, U_g2l_state, U_l2g_state, U_next_observation, flag) - INTEGER, INTENT(out) :: flag ! Status flag - EXTERNAL :: U_collect_state, & ! Routine to collect a state vector - U_distribute_state, & ! Routine to distribute a state vector - U_obs_op, & ! Observation operator - U_init_n_domains_p, & ! Provide number of local analysis domains - U_init_dim_l, & ! Init state dimension for local ana. domain - U_init_dim_obs, & ! Initialize dimension of observation vector - U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain - U_g2l_state, & ! Get state on local ana. domain from full state - U_l2g_state, & ! Init full state from state on local analysis domain - U_prepoststep, & ! User supplied pre/poststep routine - U_next_observation ! Provide time step and time of next observation - END SUBROUTINE PDAFomi_assimilate_local - END INTERFACE - - INTERFACE - SUBROUTINE PDAFomi_put_state_local_si(flag) - INTEGER, INTENT(out) :: flag ! Status flag - END SUBROUTINE PDAFomi_put_state_local_si + U_init_dim_obs, & ! Initialize dimension of observation vector + U_obs_op, & ! Observation operator + U_init_obsvar, & ! Initialize mean observation error variance + U_init_obs, & ! Initialize observation vector + U_prepoststep, & ! User supplied pre/poststep routine + U_prodRinvA, & ! Provide product R^-1 A + U_cvt, & ! Apply control vector transform matrix to control vector + U_cvt_adj, & ! Apply adjoint control vector transform matrix + U_obs_op_lin, & ! Linearized observation operator + U_obs_op_adj ! Adjoint observation operator + END SUBROUTINE PDAF_put_state_3dvar END INTERFACE INTERFACE - SUBROUTINE PDAFomi_assimilate_local_si(flag) - INTEGER, INTENT(out) :: flag ! Status flag - END SUBROUTINE PDAFomi_assimilate_local_si + SUBROUTINE PDAF_put_state_en3dvar_estkf(U_collect_state, & + U_init_dim_obs, U_obs_op, U_init_obs, U_prodRinvA, & + U_cvt_ens, U_cvt_adj_ens, U_obs_op_lin, U_obs_op_adj, & + U_init_obsvar, U_prepoststep, outflag) + INTEGER, INTENT(out) :: outflag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_init_dim_obs, & ! Initialize dimension of observation vector + U_obs_op, & ! Observation operator + U_init_obs, & ! Initialize observation vector + U_prepoststep, & ! User supplied pre/poststep routine + U_prodRinvA, & ! Provide product R^-1 A + U_cvt_ens, & ! Apply control vector transform matrix (ensemble) + U_cvt_adj_ens, & ! Apply adjoint control vector transform matrix (ensemble var) + U_obs_op_lin, & ! Linearized observation operator + U_obs_op_adj ! Adjoint observation operator + EXTERNAL :: U_init_obsvar ! Initialize mean observation error variance + END SUBROUTINE PDAF_put_state_en3dvar_estkf END INTERFACE INTERFACE - SUBROUTINE PDAFomi_put_state_global_si(flag) - INTEGER, INTENT(out) :: flag ! Status flag - END SUBROUTINE PDAFomi_put_state_global_si + SUBROUTINE PDAF_put_state_en3dvar_lestkf(U_collect_state, U_init_dim_obs, U_obs_op, & + U_init_obs, U_prodRinvA, & + U_cvt_ens, U_cvt_adj_ens, U_obs_op_lin, U_obs_op_adj, & + U_init_dim_obs_f, U_obs_op_f, U_init_obs_f, U_init_obs_l, U_prodRinvA_l, & + U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, U_g2l_state, U_l2g_state, & + U_g2l_obs, U_init_obsvar, U_init_obsvar_l, & + U_prepoststep, outflag) + INTEGER, INTENT(out) :: outflag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_init_dim_obs, & ! Initialize dimension of observation vector + U_obs_op, & ! Observation operator + U_init_obs, & ! Initialize observation vector + U_prepoststep, & ! User supplied pre/poststep routine + U_prodRinvA, & ! Provide product R^-1 A + U_cvt_ens, & ! Apply control vector transform matrix (ensemble) + U_cvt_adj_ens, & ! Apply adjoint control vector transform matrix (ensemble var) + U_obs_op_lin, & ! Linearized observation operator + U_obs_op_adj ! Adjoint observation operator + EXTERNAL :: U_obs_op_f, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs_f, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_init_obs_f, & ! Initialize PE-local observation vector + U_init_obs_l, & ! Init. observation vector on local analysis domain + U_init_obsvar, & ! Initialize mean observation error variance + U_init_obsvar_l, & ! Initialize local mean observation error variance + U_g2l_state, & ! Get state on local ana. domain from full state + U_l2g_state, & ! Init full state from state on local analysis domain + U_g2l_obs, & ! Restrict full obs. vector to local analysis domain + U_prodRinvA_l ! Provide product R^-1 A on local analysis domain + END SUBROUTINE PDAF_put_state_en3dvar_lestkf END INTERFACE INTERFACE - SUBROUTINE PDAFomi_assimilate_global_si(flag) - INTEGER, INTENT(out) :: flag ! Status flag - END SUBROUTINE PDAFomi_assimilate_global_si + SUBROUTINE PDAF_put_state_hyb3dvar_estkf(U_collect_state, U_init_dim_obs, U_obs_op, & + U_init_obs, U_prodRinvA, & + U_cvt, U_cvt_adj, U_cvt_ens, U_cvt_adj_ens, U_obs_op_lin, U_obs_op_adj, & + U_init_obsvar, U_prepoststep, outflag) + INTEGER, INTENT(out) :: outflag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_init_dim_obs, & ! Initialize dimension of observation vector + U_obs_op, & ! Observation operator + U_init_obs, & ! Initialize observation vector + U_prepoststep, & ! User supplied pre/poststep routine + U_prodRinvA, & ! Provide product R^-1 A + U_cvt_ens, & ! Apply control vector transform matrix (ensemble) + U_cvt_adj_ens, & ! Apply adjoint control vector transform matrix (ensemble var) + U_cvt, & ! Apply control vector transform matrix to control vector + U_cvt_adj, & ! Apply adjoint control vector transform matrix + U_obs_op_lin, & ! Linearized observation operator + U_obs_op_adj ! Adjoint observation operator + EXTERNAL :: U_init_obsvar ! Initialize mean observation error variance + END SUBROUTINE PDAF_put_state_hyb3dvar_estkf END INTERFACE INTERFACE - SUBROUTINE PDAFomi_assimilate_lenkf_si(flag) - INTEGER, INTENT(out) :: flag ! Status flag - END SUBROUTINE PDAFomi_assimilate_lenkf_si + SUBROUTINE PDAF_put_state_hyb3dvar_lestkf(U_collect_state, & + U_init_dim_obs, U_obs_op, U_init_obs, U_prodRinvA, & + U_cvt_ens, U_cvt_adj_ens, U_cvt, U_cvt_adj, U_obs_op_lin, U_obs_op_adj, & + U_init_dim_obs_f, U_obs_op_f, U_init_obs_f, U_init_obs_l, U_prodRinvA_l, & + U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, U_g2l_state, U_l2g_state, & + U_g2l_obs, U_init_obsvar, U_init_obsvar_l, & + U_prepoststep, outflag) + INTEGER, INTENT(out) :: outflag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_init_dim_obs, & ! Initialize dimension of observation vector + U_obs_op, & ! Observation operator + U_init_obs, & ! Initialize observation vector + U_prepoststep, & ! User supplied pre/poststep routine + U_prodRinvA, & ! Provide product R^-1 A + U_cvt_ens, & ! Apply control vector transform matrix (ensemble) + U_cvt_adj_ens, & ! Apply adjoint control vector transform matrix (ensemble var) + U_cvt, & ! Apply control vector transform matrix to control vector + U_cvt_adj, & ! Apply adjoint control vector transform matrix + U_obs_op_lin, & ! Linearized observation operator + U_obs_op_adj ! Adjoint observation operator + EXTERNAL :: U_obs_op_f, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs_f, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_init_obs_f, & ! Initialize PE-local observation vector + U_init_obs_l, & ! Init. observation vector on local analysis domain + U_init_obsvar, & ! Initialize mean observation error variance + U_init_obsvar_l, & ! Initialize local mean observation error variance + U_g2l_state, & ! Get state on local ana. domain from full state + U_l2g_state, & ! Init full state from state on local analysis domain + U_g2l_obs, & ! Restrict full obs. vector to local analysis domain + U_prodRinvA_l ! Provide product R^-1 A on local analysis domain + END SUBROUTINE PDAF_put_state_hyb3dvar_lestkf END INTERFACE INTERFACE - SUBROUTINE PDAFomi_put_state_lenkf_si(flag) - INTEGER, INTENT(out) :: flag ! Status flag - END SUBROUTINE PDAFomi_put_state_lenkf_si + SUBROUTINE PDAF_assimilate_3dvar(U_collect_state, U_distribute_state, & + U_init_dim_obs, U_obs_op, U_init_obs, U_prodRinvA, & + U_cvt, U_cvt_adj, U_obs_op_lin, U_obs_op_adj, & + U_prepoststep, U_next_observation, outflag) + INTEGER, INTENT(out) :: outflag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_init_dim_obs, & ! Initialize dimension of observation vector + U_obs_op, & ! Observation operator + U_init_obsvar, & ! Initialize mean observation error variance + U_init_obs, & ! Initialize observation vector + U_prepoststep, & ! User supplied pre/poststep routine + U_prodRinvA, & ! Provide product R^-1 A + U_next_observation, & ! Routine to provide time step, time and dimension + ! of next observation + U_distribute_state, & ! Routine to distribute a state vector + U_cvt, & ! Apply control vector transform matrix to control vector + U_cvt_adj, & ! Apply adjoint control vector transform matrix + U_obs_op_lin, & ! Linearized observation operator + U_obs_op_adj ! Adjoint observation operator + END SUBROUTINE PDAF_assimilate_3dvar END INTERFACE INTERFACE - SUBROUTINE PDAFomi_put_state_lenkf(U_collect_state, U_init_dim_obs, U_obs_op, & - U_prepoststep, U_localize, flag) - INTEGER, INTENT(out) :: flag ! Status flag - EXTERNAL :: U_collect_state, & ! Routine to collect a state vector - U_init_dim_obs, & ! Initialize dimension of observation vector - U_obs_op, & ! Observation operator - U_prepoststep, & ! User supplied pre/poststep routine - U_localize ! Apply localization to HP and HPH^T - END SUBROUTINE PDAFomi_put_state_lenkf - END INTERFACE - - INTERFACE - SUBROUTINE PDAFomi_assimilate_lenkf(U_collect_state, U_distribute_state, & - U_init_dim_obs, U_obs_op, U_prepoststep, U_localize, & - U_next_observation, flag) - INTEGER, INTENT(out) :: flag ! Status flag - EXTERNAL :: U_collect_state, & ! Routine to collect a state vector - U_distribute_state, & ! Routine to distribute a state vector - U_init_dim_obs, & ! Initialize dimension of observation vector - U_obs_op, & ! Observation operator - U_prepoststep, & ! User supplied pre/poststep routine - U_localize, & ! Apply localization to HP and HPH^T - U_next_observation ! Provide time step and time of next observation - END SUBROUTINE PDAFomi_assimilate_lenkf - END INTERFACE - - INTERFACE - SUBROUTINE PDAFomi_put_state_generate_obs(U_collect_state, U_init_dim_obs_f, U_obs_op_f, & - U_get_obs_f, U_prepoststep, flag) - INTEGER, INTENT(out) :: flag ! Status flag - EXTERNAL :: U_collect_state, & ! Routine to collect a state vector - U_init_dim_obs_f, & ! Initialize dimension of observation vector - U_obs_op_f, & ! Observation operator - U_get_obs_f, & ! Provide observation vector to user - U_prepoststep ! User supplied pre/poststep routine - END SUBROUTINE PDAFomi_put_state_generate_obs - END INTERFACE - - INTERFACE - SUBROUTINE PDAFomi_generate_obs(U_collect_state, U_distribute_state, & - U_init_dim_obs_f, U_obs_op_f, U_get_obs_f, U_prepoststep, & - U_next_observation, flag) - INTEGER, INTENT(out) :: flag ! Status flag - EXTERNAL :: U_collect_state, & ! Routine to collect a state vector - U_distribute_state, & ! Routine to distribute a state vector - U_init_dim_obs_f, & ! Initialize dimension of observation vector - U_obs_op_f, & ! Observation operator - U_get_obs_f, & ! Provide observation vector to user - U_prepoststep, & ! User supplied pre/poststep routine - U_next_observation ! Provide time step and time of next observation - END SUBROUTINE PDAFomi_generate_obs - END INTERFACE - - INTERFACE - SUBROUTINE PDAFomi_assimilate_3dvar(collect_state_pdaf, distribute_state_pdaf, & - init_dim_obs_pdaf, obs_op_pdaf, & - cvt_pdaf, cvt_adj_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & - prepoststep_pdaf, next_observation_pdaf, outflag) - INTEGER, INTENT(inout) :: outflag ! Status flag - EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector - distribute_state_pdaf, & ! Routine to distribute a state vector - next_observation_pdaf, & ! Provide time step, time and dimension of next observation - prepoststep_pdaf ! User supplied pre/poststep routine - EXTERNAL :: init_dim_obs_pdaf, & ! Initialize dimension of observation vector - obs_op_pdaf, & ! Observation operator - cvt_pdaf, & ! Apply control vector transform matrix to control vector - cvt_adj_pdaf, & ! Apply adjoint control vector transform matrix - obs_op_lin_pdaf, & ! Linearized observation operator - obs_op_adj_pdaf ! Adjoint observation operator - EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector - PDAFomi_prodRinvA_cb ! Provide product R^-1 A - END SUBROUTINE PDAFomi_assimilate_3dvar - END INTERFACE - - INTERFACE - SUBROUTINE PDAFomi_assimilate_en3dvar_estkf(collect_state_pdaf, distribute_state_pdaf, & - init_dim_obs_pdaf, obs_op_pdaf, & - cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & - prepoststep_pdaf, next_observation_pdaf, outflag) - INTEGER, INTENT(inout) :: outflag ! Status flag - EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector - distribute_state_pdaf, & ! Routine to distribute a state vector - next_observation_pdaf, & ! Provide time step, time and dimension of next observation - prepoststep_pdaf ! User supplied pre/poststep routine - EXTERNAL :: init_dim_obs_pdaf, & ! Initialize dimension of observation vector - obs_op_pdaf, & ! Observation operator - cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector - cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix - obs_op_lin_pdaf, & ! Linearized observation operator - obs_op_adj_pdaf ! Adjoint observation operator - EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector - PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance - PDAFomi_init_obscovar_cb, & ! Initialize mean observation error variance - PDAFomi_add_obs_error_cb, & ! Add observation error covariance matrix - PDAFomi_prodRinvA_cb, & ! Provide product R^-1 A - PDAFomi_likelihood_cb ! Compute likelihood - END SUBROUTINE PDAFomi_assimilate_en3dvar_estkf - END INTERFACE - - INTERFACE - SUBROUTINE PDAFomi_assimilate_en3dvar_lestkf(collect_state_pdaf, distribute_state_pdaf, & - init_dim_obs_f_pdaf, obs_op_f_pdaf, & - cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & - init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdaf, & - g2l_state_pdaf, l2g_state_pdaf, prepoststep_pdaf, next_observation_pdaf, outflag) - INTEGER, INTENT(inout) :: outflag ! Status flag - EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector - distribute_state_pdaf, & ! Routine to distribute a state vector - next_observation_pdaf, & ! Provide time step, time and dimension of next observation - prepoststep_pdaf ! User supplied pre/poststep routine - EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector - cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix - obs_op_lin_pdaf, & ! Linearized observation operator - obs_op_adj_pdaf ! Adjoint observation operator - EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains - init_dim_l_pdaf, & ! Init state dimension for local ana. domain - g2l_state_pdaf, & ! Get state on local ana. domain from full state - l2g_state_pdaf, & ! Init full state from local state - init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector - obs_op_f_pdaf, & ! Full observation operator - init_dim_obs_l_pdaf ! Initialize local dimimension of obs. vector - EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector - PDAFomi_init_obs_l_cb, & ! Initialize local observation vector - PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance - PDAFomi_init_obsvar_l_cb, & ! Initialize local mean observation error variance - PDAFomi_prodRinvA_cb, & ! Provide product R^-1 A - PDAFomi_g2l_obs_cb, & ! Restrict full obs. vector to local analysis domain - PDAFomi_prodRinvA_l_cb, & ! Provide product R^-1 A on local analysis domain - PDAFomi_likelihood_l_cb ! Compute likelihood and apply localization - END SUBROUTINE PDAFomi_assimilate_en3dvar_lestkf - END INTERFACE - - INTERFACE - SUBROUTINE PDAFomi_assimilate_hyb3dvar_estkf(collect_state_pdaf, distribute_state_pdaf, & - init_dim_obs_pdaf, obs_op_pdaf, & - cvt_ens_pdaf, cvt_adj_ens_pdaf, cvt_pdaf, cvt_adj_pdaf, & - obs_op_lin_pdaf, obs_op_adj_pdaf, prepoststep_pdaf, next_observation_pdaf, outflag) - INTEGER, INTENT(inout) :: outflag ! Status flag - EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector - distribute_state_pdaf, & ! Routine to distribute a state vector - next_observation_pdaf, & ! Provide time step, time and dimension of next observation - prepoststep_pdaf ! User supplied pre/poststep routine - EXTERNAL :: init_dim_obs_pdaf, & ! Initialize dimension of observation vector - obs_op_pdaf, & ! Observation operator - cvt_pdaf, & ! Apply control vector transform matrix to control vector - cvt_adj_pdaf, & ! Apply adjoint control vector transform matrix - cvt_ens_pdaf, & ! Apply ensemble control vector transform matrix to control vector - cvt_adj_ens_pdaf, & ! Apply adjoint ensemble control vector transform matrix - obs_op_lin_pdaf, & ! Linearized observation operator - obs_op_adj_pdaf ! Adjoint observation operator - EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector - PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance - PDAFomi_init_obscovar_cb, & ! Initialize mean observation error variance - PDAFomi_add_obs_error_cb, & ! Add observation error covariance matrix - PDAFomi_prodRinvA_cb, & ! Provide product R^-1 A - PDAFomi_likelihood_cb ! Compute likelihood - END SUBROUTINE PDAFomi_assimilate_hyb3dvar_estkf - END INTERFACE - - INTERFACE - SUBROUTINE PDAFomi_assimilate_hyb3dvar_lestkf(collect_state_pdaf, distribute_state_pdaf, & - init_dim_obs_f_pdaf, obs_op_f_pdaf, & - cvt_ens_pdaf, cvt_adj_ens_pdaf, cvt_pdaf, cvt_adj_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & - init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdaf, & - g2l_state_pdaf, l2g_state_pdaf, prepoststep_pdaf, next_observation_pdaf, outflag) - INTEGER, INTENT(inout) :: outflag ! Status flag - EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector - distribute_state_pdaf, & ! Routine to distribute a state vector - next_observation_pdaf, & ! Provide time step, time and dimension of next observation - prepoststep_pdaf ! User supplied pre/poststep routine - EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector - cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix - cvt_pdaf, & ! Apply control vector transform matrix to control vector - cvt_adj_pdaf, & ! Apply adjoint control vector transform matrix - obs_op_lin_pdaf, & ! Linearized observation operator - obs_op_adj_pdaf ! Adjoint observation operator - EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains - init_dim_l_pdaf, & ! Init state dimension for local ana. domain - g2l_state_pdaf, & ! Get state on local ana. domain from full state - l2g_state_pdaf, & ! Init full state from local state - init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector - obs_op_f_pdaf, & ! Full observation operator - init_dim_obs_l_pdaf ! Initialize local dimimension of obs. vector - EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector - PDAFomi_init_obs_l_cb, & ! Initialize local observation vector - PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance - PDAFomi_init_obsvar_l_cb, & ! Initialize local mean observation error variance - PDAFomi_prodRinvA_cb, & ! Provide product R^-1 A - PDAFomi_g2l_obs_cb, & ! Restrict full obs. vector to local analysis domain - PDAFomi_prodRinvA_l_cb, & ! Provide product R^-1 A on local analysis domain - PDAFomi_likelihood_l_cb ! Compute likelihood and apply localization - END SUBROUTINE PDAFomi_assimilate_hyb3dvar_lestkf - END INTERFACE - - INTERFACE - SUBROUTINE PDAF_assimilate_3dvar(U_collect_state, U_distribute_state, & - U_init_dim_obs, U_obs_op, U_init_obs, U_prodRinvA, & - U_cvt, U_cvt_adj, U_obs_op_lin, U_obs_op_adj, & - U_prepoststep, U_next_observation, outflag) - INTEGER, INTENT(out) :: outflag ! Status flag - EXTERNAL :: U_collect_state, & ! Routine to collect a state vector - U_init_dim_obs, & ! Initialize dimension of observation vector - U_obs_op, & ! Observation operator - U_init_obsvar, & ! Initialize mean observation error variance - U_init_obs, & ! Initialize observation vector - U_prepoststep, & ! User supplied pre/poststep routine - U_prodRinvA, & ! Provide product R^-1 A - U_next_observation, & ! Routine to provide time step, time and dimension - ! of next observation - U_distribute_state, & ! Routine to distribute a state vector - U_cvt, & ! Apply control vector transform matrix to control vector - U_cvt_adj, & ! Apply adjoint control vector transform matrix - U_obs_op_lin, & ! Linearized observation operator - U_obs_op_adj ! Adjoint observation operator - END SUBROUTINE PDAF_assimilate_3dvar - END INTERFACE - - INTERFACE - SUBROUTINE PDAF_assimilate_en3dvar_estkf(U_collect_state, U_distribute_state, & - U_init_dim_obs, U_obs_op, U_init_obs, U_prodRinvA, & - U_cvt_ens, U_cvt_adj_ens, U_obs_op_lin, U_obs_op_adj, & - U_init_obsvar, U_prepoststep, U_next_observation, outflag) - INTEGER, INTENT(out) :: outflag ! Status flag - EXTERNAL :: U_collect_state, & ! Routine to collect a state vector - U_init_dim_obs, & ! Initialize dimension of observation vector - U_obs_op, & ! Observation operator - U_init_obsvar, & ! Initialize mean observation error variance - U_init_obs, & ! Initialize observation vector - U_prepoststep, & ! User supplied pre/poststep routine - U_prodRinvA, & ! Provide product R^-1 A - U_next_observation, & ! Routine to provide time step, time and dimension - ! of next observation - U_distribute_state, & ! Routine to distribute a state vector - U_cvt_ens, & ! Apply control vector transform matrix (ensemble) - U_cvt_adj_ens, & ! Apply adjoint control vector transform matrix (ensemble var) - U_cvt, & ! Apply control vector transform matrix to control vector - U_cvt_adj, & ! Apply adjoint control vector transform matrix - U_obs_op_lin, & ! Linearized observation operator - U_obs_op_adj ! Adjoint observation operator - END SUBROUTINE PDAF_assimilate_en3dvar_estkf + SUBROUTINE PDAF_assimilate_en3dvar_estkf(U_collect_state, U_distribute_state, & + U_init_dim_obs, U_obs_op, U_init_obs, U_prodRinvA, & + U_cvt_ens, U_cvt_adj_ens, U_obs_op_lin, U_obs_op_adj, & + U_init_obsvar, U_prepoststep, U_next_observation, outflag) + INTEGER, INTENT(out) :: outflag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_init_dim_obs, & ! Initialize dimension of observation vector + U_obs_op, & ! Observation operator + U_init_obsvar, & ! Initialize mean observation error variance + U_init_obs, & ! Initialize observation vector + U_prepoststep, & ! User supplied pre/poststep routine + U_prodRinvA, & ! Provide product R^-1 A + U_next_observation, & ! Routine to provide time step, time and dimension + ! of next observation + U_distribute_state, & ! Routine to distribute a state vector + U_cvt_ens, & ! Apply control vector transform matrix (ensemble) + U_cvt_adj_ens, & ! Apply adjoint control vector transform matrix (ensemble var) + U_cvt, & ! Apply control vector transform matrix to control vector + U_cvt_adj, & ! Apply adjoint control vector transform matrix + U_obs_op_lin, & ! Linearized observation operator + U_obs_op_adj ! Adjoint observation operator + END SUBROUTINE PDAF_assimilate_en3dvar_estkf END INTERFACE INTERFACE @@ -1538,54 +1428,815 @@ SUBROUTINE PDAF_assimilate_hyb3dvar_lestkf(U_collect_state, U_distribute_state, END SUBROUTINE PDAF_assimilate_hyb3dvar_lestkf END INTERFACE + INTERFACE + SUBROUTINE PDAF_set_debug_flag(debugval) + INTEGER, INTENT(in) :: debugval ! Value of debugging flag; print debug information for >0 + END SUBROUTINE PDAF_set_debug_flag + END INTERFACE + + INTERFACE + SUBROUTINE PDAF_set_offline_mode(screen) + INTEGER, INTENT(in) :: screen ! Verbosity flag + END SUBROUTINE PDAF_set_offline_mode + END INTERFACE + INTERFACE - SUBROUTINE PDAFomi_put_state_3dvar(collect_state_pdaf, init_dim_obs_pdaf, obs_op_pdaf, & - cvt_pdaf, cvt_adj_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, prepoststep_pdaf, outflag) - INTEGER, INTENT(inout) :: outflag ! Status flag - EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector - prepoststep_pdaf ! User supplied pre/poststep routine - EXTERNAL :: init_dim_obs_pdaf, & ! Initialize dimension of observation vector - obs_op_pdaf, & ! Observation operator - cvt_pdaf, & ! Apply control vector transform matrix to control vector - cvt_adj_pdaf, & ! Apply adjoint control vector transform matrix - obs_op_lin_pdaf, & ! Linearized observation operator - obs_op_adj_pdaf ! Adjoint observation operator - EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector - PDAFomi_prodRinvA_cb ! Provide product R^-1 A - END SUBROUTINE PDAFomi_put_state_3dvar + SUBROUTINE PDAF_g2l(dim_p, dim_l, idx_l_in_p, state_p, state_l) + INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension + INTEGER, INTENT(in) :: dim_l !< Local state dimension + INTEGER, INTENT(in) :: idx_l_in_p(dim_l) !< Index array for projection + REAL, INTENT(in) :: state_p(dim_p) !< PE-local full state vector + REAL, INTENT(out) :: state_l(dim_l) !< State vector on local analysis domain + END SUBROUTINE PDAF_g2l END INTERFACE INTERFACE - SUBROUTINE PDAFomi_put_state_en3dvar_estkf(collect_state_pdaf, & - init_dim_obs_pdaf, obs_op_pdaf, & - cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & - prepoststep_pdaf, outflag) - INTEGER, INTENT(inout) :: outflag ! Status flag - EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector - prepoststep_pdaf ! User supplied pre/poststep routine - EXTERNAL :: init_dim_obs_pdaf, & ! Initialize dimension of observation vector - obs_op_pdaf, & ! Observation operator - cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector - cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix - obs_op_lin_pdaf, & ! Linearized observation operator - obs_op_adj_pdaf ! Adjoint observation operator - EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector - PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance - PDAFomi_init_obscovar_cb, & ! Initialize mean observation error variance - PDAFomi_add_obs_error_cb, & ! Add observation error covariance matrix - PDAFomi_prodRinvA_cb, & ! Provide product R^-1 A - PDAFomi_likelihood_cb ! Compute likelihood - END SUBROUTINE PDAFomi_put_state_en3dvar_estkf + SUBROUTINE PDAF_l2g(dim_p, dim_l, idx_l_in_p, state_p, state_l) + INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension + INTEGER, INTENT(in) :: dim_l !< Local state dimension + INTEGER, INTENT(in) :: idx_l_in_p(dim_l) !< Index array for projection + REAL, INTENT(inout) :: state_p(dim_p) !< PE-local full state vector + REAL, INTENT(in) :: state_l(dim_l) !< State vector on local analysis domain + END SUBROUTINE PDAF_l2g END INTERFACE + +! OMI INTERFACES --------------------- + INTERFACE - SUBROUTINE PDAFomi_put_state_en3dvar_lestkf(collect_state_pdaf, & - init_dim_obs_f_pdaf, obs_op_f_pdaf, & - cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & - init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdaf, & - g2l_state_pdaf, l2g_state_pdaf, prepoststep_pdaf, outflag) - INTEGER, INTENT(inout) :: outflag ! Status flag - EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + SUBROUTINE PDAFomi_put_state_global(U_collect_state, U_init_dim_obs, U_obs_op, & + U_prepoststep, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_init_dim_obs, & ! Initialize dimension of observation vector + U_obs_op, & ! Observation operator + U_prepoststep ! User supplied pre/poststep routine + END SUBROUTINE PDAFomi_put_state_global + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_put_state_global_nondiagR(U_collect_state, U_init_dim_obs, U_obs_op, & + U_prodRinvA, U_prepoststep, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_init_dim_obs, & ! Initialize dimension of observation vector + U_obs_op, & ! Observation operator + U_prodRinvA, & ! Provide product R^-1 A + U_prepoststep ! User supplied pre/poststep routine + END SUBROUTINE PDAFomi_put_state_global_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_put_state_nonlin_nondiagR(U_collect_state, U_init_dim_obs, U_obs_op, & + U_likelihood, U_prepoststep, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_init_dim_obs, & ! Initialize dimension of observation vector + U_obs_op, & ! Observation operator + U_likelihood, & ! Compute likelihood + U_prepoststep ! User supplied pre/poststep routine + END SUBROUTINE PDAFomi_put_state_nonlin_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_put_state_enkf_nondiagR(U_collect_state, U_init_dim_obs, U_obs_op, & + U_prepoststep, U_add_obs_err, U_init_obs_covar, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_init_dim_obs, & ! Initialize dimension of observation vector + U_obs_op, & ! Observation operator + U_add_obs_err, & ! Add obs error covariance R to HPH in EnKF + U_init_obs_covar, & ! Initialize obs. error cov. matrix R in EnKF + U_prepoststep ! User supplied pre/poststep routine + END SUBROUTINE PDAFomi_put_state_enkf_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_put_state_lenkf_nondiagR(U_collect_state, U_init_dim_obs, U_obs_op, & + U_prepoststep, U_localize, U_add_obs_err, U_init_obs_covar, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_init_dim_obs, & ! Initialize dimension of observation vector + U_obs_op, & ! Observation operator + U_add_obs_err, & ! Add obs error covariance R to HPH in EnKF + U_init_obs_covar, & ! Initialize obs. error cov. matrix R in EnKF + U_localize, & ! Apply localization to HP and HPH^T + U_prepoststep ! User supplied pre/poststep routine + END SUBROUTINE PDAFomi_put_state_lenkf_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_assimilate_global(U_collect_state, U_distribute_state, & + U_init_dim_obs, U_obs_op, U_prepoststep, U_next_observation, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_distribute_state, & ! Routine to distribute a state vector + U_init_dim_obs, & ! Initialize dimension of observation vector + U_obs_op, & ! Observation operator + U_prepoststep, & ! User supplied pre/poststep routine + U_next_observation ! Provide time step and time of next observation + END SUBROUTINE PDAFomi_assimilate_global + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_put_state_local(U_collect_state, U_init_dim_obs, U_obs_op, & + U_prepoststep, U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, & + U_g2l_state, U_l2g_state, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_g2l_state, & ! Get state on local ana. domain from full state + U_l2g_state, & ! Init full state from state on local analysis domain + U_prepoststep ! User supplied pre/poststep routine + END SUBROUTINE PDAFomi_put_state_local + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_put_state_local_nondiagR(U_collect_state, U_init_dim_obs, U_obs_op, & + U_prepoststep, U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, U_prodRinvA_l, & + U_g2l_state, U_l2g_state, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_prodRinvA_l, & ! Provide product R^-1 A on local analysis domain + U_g2l_state, & ! Get state on local ana. domain from full state + U_l2g_state, & ! Init full state from state on local analysis domain + U_prepoststep ! User supplied pre/poststep routine + END SUBROUTINE PDAFomi_put_state_local_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_put_state_lnetf_nondiagR(U_collect_state, U_init_dim_obs, U_obs_op, & + U_prepoststep, U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, U_likelihood_l, & + U_g2l_state, U_l2g_state, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_likelihood_l, & ! Compute likelihood and apply localization + U_g2l_state, & ! Get state on local ana. domain from full state + U_l2g_state, & ! Init full state from state on local analysis domain + U_prepoststep ! User supplied pre/poststep routine + END SUBROUTINE PDAFomi_put_state_lnetf_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_put_state_lknetf_nondiagR(U_collect_state, U_init_dim_obs, U_obs_op, & + U_prepoststep, U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, & + U_prodRinvA_l, U_prodRinvA_hyb_l, U_likelihood_l, U_likelihood_hyb_l, & + U_g2l_state, U_l2g_state, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_prodRinvA_l, & ! Provide product R^-1 A on local analysis domain + U_prodRinvA_hyb_l, & ! Product R^-1 A on local analysis domain with hybrid weight + U_likelihood_l, & ! Compute likelihood and apply localization + U_likelihood_hyb_l, & ! Compute likelihood and apply localization with tempering + U_g2l_state, & ! Get state on local ana. domain from full state + U_l2g_state, & ! Init full state from state on local analysis domain + U_prepoststep ! User supplied pre/poststep routine + END SUBROUTINE PDAFomi_put_state_lknetf_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_assimilate_local(U_collect_state, U_distribute_state, & + U_init_dim_obs, U_obs_op, U_prepoststep, U_init_n_domains_p, U_init_dim_l, & + U_init_dim_obs_l, U_g2l_state, U_l2g_state, U_next_observation, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_distribute_state, & ! Routine to distribute a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_g2l_state, & ! Get state on local ana. domain from full state + U_l2g_state, & ! Init full state from state on local analysis domain + U_prepoststep, & ! User supplied pre/poststep routine + U_next_observation ! Provide time step and time of next observation + END SUBROUTINE PDAFomi_assimilate_local + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_assimilate_local_nondiagR(U_collect_state, U_distribute_state, & + U_init_dim_obs, U_obs_op, U_prepoststep, U_init_n_domains_p, U_init_dim_l, & + U_init_dim_obs_l, U_prodRinvA_l, U_g2l_state, U_l2g_state, U_next_observation, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_distribute_state, & ! Routine to distribute a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_prodRinvA_l, & ! Provide product R^-1 A on local analysis domain + U_g2l_state, & ! Get state on local ana. domain from full state + U_l2g_state, & ! Init full state from state on local analysis domain + U_prepoststep, & ! User supplied pre/poststep routine + U_next_observation ! Provide time step and time of next observation + END SUBROUTINE PDAFomi_assimilate_local_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_assimilate_lnetf_nondiagR(U_collect_state, U_distribute_state, & + U_init_dim_obs, U_obs_op, U_prepoststep, U_init_n_domains_p, U_init_dim_l, & + U_init_dim_obs_l, U_likelihood_l, U_g2l_state, U_l2g_state, U_next_observation, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_distribute_state, & ! Routine to distribute a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_likelihood_l, & ! Compute likelihood and apply localization + U_g2l_state, & ! Get state on local ana. domain from full state + U_l2g_state, & ! Init full state from state on local analysis domain + U_prepoststep, & ! User supplied pre/poststep routine + U_next_observation ! Provide time step and time of next observation + END SUBROUTINE PDAFomi_assimilate_lnetf_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_assimilate_lknetf_nondiagR(U_collect_state, U_distribute_state, & + U_init_dim_obs, U_obs_op, U_prepoststep, U_init_n_domains_p, U_init_dim_l, & + U_init_dim_obs_l, U_prodRinvA_l, U_prodRinvA_hyb_l, U_likelihood_l, U_likelihood_hyb_l, & + U_g2l_state, U_l2g_state, U_next_observation, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_distribute_state, & ! Routine to distribute a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_prodRinvA_l, & ! Provide product R^-1 A on local analysis domain + U_prodRinvA_hyb_l, & ! Product R^-1 A on local analysis domain with hybrid weight + U_likelihood_l, & ! Compute likelihood and apply localization + U_likelihood_hyb_l, & ! Compute likelihood and apply localization with tempering + U_g2l_state, & ! Get state on local ana. domain from full state + U_l2g_state, & ! Init full state from state on local analysis domain + U_prepoststep, & ! User supplied pre/poststep routine + U_next_observation ! Provide time step and time of next observation + END SUBROUTINE PDAFomi_assimilate_lknetf_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_assimilate_global_nondiagR(U_collect_state, U_distribute_state, & + U_init_dim_obs, U_obs_op, U_prodRinvA, U_prepoststep, U_next_observation, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_distribute_state, & ! Routine to distribute a state vector + U_init_dim_obs, & ! Initialize dimension of observation vector + U_obs_op, & ! Observation operator + U_prodRinvA, & ! Provide product R^-1 A + U_prepoststep, & ! User supplied pre/poststep routine + U_next_observation ! Provide time step and time of next observation + END SUBROUTINE PDAFomi_assimilate_global_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_assimilate_nonlin_nondiagR(U_collect_state, U_distribute_state, & + U_init_dim_obs, U_obs_op, U_likelihood, U_prepoststep, U_next_observation, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_distribute_state, & ! Routine to distribute a state vector + U_init_dim_obs, & ! Initialize dimension of observation vector + U_obs_op, & ! Observation operator + U_likelihood, & ! Compute likelihood + U_prepoststep, & ! User supplied pre/poststep routine + U_next_observation ! Provide time step and time of next observation + END SUBROUTINE PDAFomi_assimilate_nonlin_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_assimilate_enkf_nondiagR(U_collect_state, U_distribute_state, & + U_init_dim_obs, U_obs_op, U_add_obs_err, U_init_obs_covar, & + U_prepoststep, U_next_observation, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_distribute_state, & ! Routine to distribute a state vector + U_init_dim_obs, & ! Initialize dimension of observation vector + U_obs_op, & ! Observation operator + U_add_obs_err, & ! Add obs error covariance R to HPH in EnKF + U_init_obs_covar, & ! Initialize obs. error cov. matrix R in EnKF + U_prepoststep, & ! User supplied pre/poststep routine + U_next_observation ! Provide time step and time of next observation + END SUBROUTINE PDAFomi_assimilate_enkf_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_assimilate_lenkf_nondiagR(U_collect_state, U_distribute_state, & + U_init_dim_obs, U_obs_op, U_prepoststep, U_localize, & + U_add_obs_error, U_init_obs_covar, U_next_observation, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_distribute_state, & ! Routine to distribute a state vector + U_init_dim_obs, & ! Initialize dimension of observation vector + U_obs_op, & ! Observation operator + U_init_obs_covar, & ! Initialize obs. error cov. matrix R in EnKF + U_prepoststep, & ! User supplied pre/poststep routine + U_localize, & ! Apply localization to HP and HPH^T + U_add_obs_error, & ! Add obs error covariance R to HPH in EnKF + U_next_observation ! Provide time step and time of next observation + END SUBROUTINE PDAFomi_assimilate_lenkf_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_put_state_local_si(flag) + INTEGER, INTENT(out) :: flag ! Status flag + END SUBROUTINE PDAFomi_put_state_local_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_assimilate_local_si(flag) + INTEGER, INTENT(out) :: flag ! Status flag + END SUBROUTINE PDAFomi_assimilate_local_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_assimilate_local_nondiagR_si(flag) + INTEGER, INTENT(out) :: flag ! Status flag + END SUBROUTINE PDAFomi_assimilate_local_nondiagR_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_assimilate_global_nondiagR_si(flag) + INTEGER, INTENT(out) :: flag ! Status flag + END SUBROUTINE PDAFomi_assimilate_global_nondiagR_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_assimilate_enkf_nondiagR_si(flag) + INTEGER, INTENT(out) :: flag ! Status flag + END SUBROUTINE PDAFomi_assimilate_enkf_nondiagR_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_assimilate_nonlin_nondiagR_si(flag) + INTEGER, INTENT(out) :: flag ! Status flag + END SUBROUTINE PDAFomi_assimilate_nonlin_nondiagR_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_assimilate_lenkf_nondiagR_si(flag) + INTEGER, INTENT(out) :: flag ! Status flag + END SUBROUTINE PDAFomi_assimilate_lenkf_nondiagR_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_assimilate_lnetf_nondiagR_si(flag) + INTEGER, INTENT(out) :: flag ! Status flag + END SUBROUTINE PDAFomi_assimilate_lnetf_nondiagR_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_assimilate_lknetf_nondiagR_si(flag) + INTEGER, INTENT(out) :: flag ! Status flag + END SUBROUTINE PDAFomi_assimilate_lknetf_nondiagR_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_put_state_global_si(flag) + INTEGER, INTENT(out) :: flag ! Status flag + END SUBROUTINE PDAFomi_put_state_global_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_assimilate_global_si(flag) + INTEGER, INTENT(out) :: flag ! Status flag + END SUBROUTINE PDAFomi_assimilate_global_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_assimilate_lenkf_si(flag) + INTEGER, INTENT(out) :: flag ! Status flag + END SUBROUTINE PDAFomi_assimilate_lenkf_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_put_state_lenkf_si(flag) + INTEGER, INTENT(out) :: flag ! Status flag + END SUBROUTINE PDAFomi_put_state_lenkf_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_put_state_local_nondiagR_si(flag) + INTEGER, INTENT(out) :: flag ! Status flag + END SUBROUTINE PDAFomi_put_state_local_nondiagR_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_put_state_global_nondiagR_si(flag) + INTEGER, INTENT(out) :: flag ! Status flag + END SUBROUTINE PDAFomi_put_state_global_nondiagR_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_put_state_enkf_nondiagR_si(flag) + INTEGER, INTENT(out) :: flag ! Status flag + END SUBROUTINE PDAFomi_put_state_enkf_nondiagR_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_put_state_nonlin_nondiagR_si(flag) + INTEGER, INTENT(out) :: flag ! Status flag + END SUBROUTINE PDAFomi_put_state_nonlin_nondiagR_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_put_state_lenkf_nondiagR_si(flag) + INTEGER, INTENT(out) :: flag ! Status flag + END SUBROUTINE PDAFomi_put_state_lenkf_nondiagR_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_put_state_lknetf_nondiagR_si(flag) + INTEGER, INTENT(out) :: flag ! Status flag + END SUBROUTINE PDAFomi_put_state_lknetf_nondiagR_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_put_state_lnetf_nondiagR_si(flag) + INTEGER, INTENT(out) :: flag ! Status flag + END SUBROUTINE PDAFomi_put_state_lnetf_nondiagR_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_put_state_lenkf(U_collect_state, U_init_dim_obs, U_obs_op, & + U_prepoststep, U_localize, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_init_dim_obs, & ! Initialize dimension of observation vector + U_obs_op, & ! Observation operator + U_prepoststep, & ! User supplied pre/poststep routine + U_localize ! Apply localization to HP and HPH^T + END SUBROUTINE PDAFomi_put_state_lenkf + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_assimilate_lenkf(U_collect_state, U_distribute_state, & + U_init_dim_obs, U_obs_op, U_prepoststep, U_localize, & + U_next_observation, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_distribute_state, & ! Routine to distribute a state vector + U_init_dim_obs, & ! Initialize dimension of observation vector + U_obs_op, & ! Observation operator + U_prepoststep, & ! User supplied pre/poststep routine + U_localize, & ! Apply localization to HP and HPH^T + U_next_observation ! Provide time step and time of next observation + END SUBROUTINE PDAFomi_assimilate_lenkf + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_put_state_generate_obs(U_collect_state, U_init_dim_obs_f, U_obs_op_f, & + U_get_obs_f, U_prepoststep, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_init_dim_obs_f, & ! Initialize dimension of observation vector + U_obs_op_f, & ! Observation operator + U_get_obs_f, & ! Provide observation vector to user + U_prepoststep ! User supplied pre/poststep routine + END SUBROUTINE PDAFomi_put_state_generate_obs + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_generate_obs(U_collect_state, U_distribute_state, & + U_init_dim_obs_f, U_obs_op_f, U_get_obs_f, U_prepoststep, & + U_next_observation, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_distribute_state, & ! Routine to distribute a state vector + U_init_dim_obs_f, & ! Initialize dimension of observation vector + U_obs_op_f, & ! Observation operator + U_get_obs_f, & ! Provide observation vector to user + U_prepoststep, & ! User supplied pre/poststep routine + U_next_observation ! Provide time step and time of next observation + END SUBROUTINE PDAFomi_generate_obs + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_assimilate_3dvar(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdaf, obs_op_pdaf, & + cvt_pdaf, cvt_adj_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & + prepoststep_pdaf, next_observation_pdaf, outflag) + INTEGER, INTENT(inout) :: outflag ! Status flag + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_dim_obs_pdaf, & ! Initialize dimension of observation vector + obs_op_pdaf, & ! Observation operator + cvt_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_pdaf, & ! Apply adjoint control vector transform matrix + obs_op_lin_pdaf, & ! Linearized observation operator + obs_op_adj_pdaf ! Adjoint observation operator + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector + PDAFomi_prodRinvA_cb ! Provide product R^-1 A + END SUBROUTINE PDAFomi_assimilate_3dvar + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_assimilate_3dvar_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdaf, obs_op_pdaf, prodRinvA_pdaf, & + cvt_pdaf, cvt_adj_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & + prepoststep_pdaf, next_observation_pdaf, outflag) + INTEGER, INTENT(inout) :: outflag ! Status flag + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_dim_obs_pdaf, & ! Initialize dimension of observation vector + obs_op_pdaf, & ! Observation operator + prodRinvA_pdaf, & ! Provide product R^-1 A + cvt_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_pdaf, & ! Apply adjoint control vector transform matrix + obs_op_lin_pdaf, & ! Linearized observation operator + obs_op_adj_pdaf ! Adjoint observation operator + END SUBROUTINE PDAFomi_assimilate_3dvar_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_assimilate_en3dvar_estkf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdaf, obs_op_pdaf, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & + prepoststep_pdaf, next_observation_pdaf, outflag) + INTEGER, INTENT(inout) :: outflag ! Status flag + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_dim_obs_pdaf, & ! Initialize dimension of observation vector + obs_op_pdaf, & ! Observation operator + cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix + obs_op_lin_pdaf, & ! Linearized observation operator + obs_op_adj_pdaf ! Adjoint observation operator + END SUBROUTINE PDAFomi_assimilate_en3dvar_estkf + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_assimilate_en3dvar_estkf_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdaf, obs_op_pdaf, prodRinvA_pdaf, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & + prepoststep_pdaf, next_observation_pdaf, outflag) + INTEGER, INTENT(inout) :: outflag ! Status flag + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_dim_obs_pdaf, & ! Initialize dimension of observation vector + obs_op_pdaf, & ! Observation operator + prodRinvA_pdaf, & ! Provide product R^-1 A + cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix + obs_op_lin_pdaf, & ! Linearized observation operator + obs_op_adj_pdaf ! Adjoint observation operator + END SUBROUTINE PDAFomi_assimilate_en3dvar_estkf_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_assimilate_en3dvar_lestkf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & + init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdaf, & + g2l_state_pdaf, l2g_state_pdaf, prepoststep_pdaf, next_observation_pdaf, outflag) + INTEGER, INTENT(inout) :: outflag ! Status flag + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix + obs_op_lin_pdaf, & ! Linearized observation operator + obs_op_adj_pdaf ! Adjoint observation operator + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + g2l_state_pdaf, & ! Get state on local ana. domain from full state + l2g_state_pdaf, & ! Init full state from local state + init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector + obs_op_f_pdaf, & ! Full observation operator + init_dim_obs_l_pdaf ! Initialize local dimimension of obs. vector + END SUBROUTINE PDAFomi_assimilate_en3dvar_lestkf + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_assimilate_en3dvar_lestkf_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, prodRinvA_pdaf, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & + prodRinvA_l_pdaf, init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdaf, & + g2l_state_pdaf, l2g_state_pdaf, prepoststep_pdaf, next_observation_pdaf, outflag) + INTEGER, INTENT(inout) :: outflag ! Status flag + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix + obs_op_lin_pdaf, & ! Linearized observation operator + obs_op_adj_pdaf ! Adjoint observation operator + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + prodRinvA_pdaf, & ! Provide product R^-1 A + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + g2l_state_pdaf, & ! Get state on local ana. domain from full state + l2g_state_pdaf, & ! Init full state from local state + init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector + obs_op_f_pdaf, & ! Full observation operator + init_dim_obs_l_pdaf, & ! Initialize local dimimension of obs. vector + prodRinvA_l_pdaf ! Provide product R^-1 A with localization + END SUBROUTINE PDAFomi_assimilate_en3dvar_lestkf_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_assimilate_hyb3dvar_estkf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdaf, obs_op_pdaf, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, cvt_pdaf, cvt_adj_pdaf, & + obs_op_lin_pdaf, obs_op_adj_pdaf, prepoststep_pdaf, next_observation_pdaf, outflag) + INTEGER, INTENT(inout) :: outflag ! Status flag + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_dim_obs_pdaf, & ! Initialize dimension of observation vector + obs_op_pdaf, & ! Observation operator + cvt_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_pdaf, & ! Apply adjoint control vector transform matrix + cvt_ens_pdaf, & ! Apply ensemble control vector transform matrix to control vector + cvt_adj_ens_pdaf, & ! Apply adjoint ensemble control vector transform matrix + obs_op_lin_pdaf, & ! Linearized observation operator + obs_op_adj_pdaf ! Adjoint observation operator + END SUBROUTINE PDAFomi_assimilate_hyb3dvar_estkf + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_assimilate_hyb3dvar_estkf_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdaf, obs_op_pdaf, prodRinvA_pdaf, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, cvt_pdaf, cvt_adj_pdaf, & + obs_op_lin_pdaf, obs_op_adj_pdaf, prepoststep_pdaf, next_observation_pdaf, outflag) + INTEGER, INTENT(inout) :: outflag ! Status flag + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_dim_obs_pdaf, & ! Initialize dimension of observation vector + obs_op_pdaf, & ! Observation operator + prodRinvA_pdaf, & ! Provide product R^-1 A + cvt_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_pdaf, & ! Apply adjoint control vector transform matrix + cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix + obs_op_lin_pdaf, & ! Linearized observation operator + obs_op_adj_pdaf ! Adjoint observation operator + END SUBROUTINE PDAFomi_assimilate_hyb3dvar_estkf_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_assimilate_hyb3dvar_lestkf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, cvt_pdaf, cvt_adj_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & + init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdaf, & + g2l_state_pdaf, l2g_state_pdaf, prepoststep_pdaf, next_observation_pdaf, outflag) + INTEGER, INTENT(inout) :: outflag ! Status flag + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix + cvt_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_pdaf, & ! Apply adjoint control vector transform matrix + obs_op_lin_pdaf, & ! Linearized observation operator + obs_op_adj_pdaf ! Adjoint observation operator + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + g2l_state_pdaf, & ! Get state on local ana. domain from full state + l2g_state_pdaf, & ! Init full state from local state + init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector + obs_op_f_pdaf, & ! Full observation operator + init_dim_obs_l_pdaf ! Initialize local dimimension of obs. vector + END SUBROUTINE PDAFomi_assimilate_hyb3dvar_lestkf + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_assimilate_hyb3dvar_lestkf_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, prodRinvA_pdaf, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, cvt_pdaf, cvt_adj_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & + prodRinvA_l_pdaf, init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdaf, & + g2l_state_pdaf, l2g_state_pdaf, prepoststep_pdaf, next_observation_pdaf, outflag) + INTEGER, INTENT(inout) :: outflag ! Status flag + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix + cvt_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_pdaf, & ! Apply adjoint control vector transform matrix + obs_op_lin_pdaf, & ! Linearized observation operator + obs_op_adj_pdaf ! Adjoint observation operator + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + prodRinvA_pdaf, & ! Provide product R^-1 A + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + g2l_state_pdaf, & ! Get state on local ana. domain from full state + l2g_state_pdaf, & ! Init full state from local state + init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector + obs_op_f_pdaf, & ! Full observation operator + init_dim_obs_l_pdaf, & ! Initialize local dimimension of obs. vector + prodRinvA_l_pdaf ! Provide product R^-1 A with localization + END SUBROUTINE PDAFomi_assimilate_hyb3dvar_lestkf_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_put_state_3dvar(collect_state_pdaf, init_dim_obs_pdaf, obs_op_pdaf, & + cvt_pdaf, cvt_adj_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, prepoststep_pdaf, outflag) + INTEGER, INTENT(inout) :: outflag ! Status flag + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_dim_obs_pdaf, & ! Initialize dimension of observation vector + obs_op_pdaf, & ! Observation operator + cvt_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_pdaf, & ! Apply adjoint control vector transform matrix + obs_op_lin_pdaf, & ! Linearized observation operator + obs_op_adj_pdaf ! Adjoint observation operator + END SUBROUTINE PDAFomi_put_state_3dvar + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_put_state_3dvar_nondiagR(collect_state_pdaf, & + init_dim_obs_pdaf, obs_op_pdaf, prodRinvA_pdaf, & + cvt_pdaf, cvt_adj_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, prepoststep_pdaf, outflag) + INTEGER, INTENT(inout) :: outflag ! Status flag + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_dim_obs_pdaf, & ! Initialize dimension of observation vector + obs_op_pdaf, & ! Observation operator + prodRinvA_pdaf, & ! Provide product R^-1 A + cvt_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_pdaf, & ! Apply adjoint control vector transform matrix + obs_op_lin_pdaf, & ! Linearized observation operator + obs_op_adj_pdaf ! Adjoint observation operator + END SUBROUTINE PDAFomi_put_state_3dvar_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_put_state_en3dvar_estkf(collect_state_pdaf, & + init_dim_obs_pdaf, obs_op_pdaf, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & + prepoststep_pdaf, outflag) + INTEGER, INTENT(inout) :: outflag ! Status flag + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_dim_obs_pdaf, & ! Initialize dimension of observation vector + obs_op_pdaf, & ! Observation operator + cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix + obs_op_lin_pdaf, & ! Linearized observation operator + obs_op_adj_pdaf ! Adjoint observation operator + END SUBROUTINE PDAFomi_put_state_en3dvar_estkf + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_put_state_en3dvar_estkf_nondiagR(collect_state_pdaf, & + init_dim_obs_pdaf, obs_op_pdaf, prodRinvA_pdaf, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & + prepoststep_pdaf, outflag) + INTEGER, INTENT(inout) :: outflag ! Status flag + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_dim_obs_pdaf, & ! Initialize dimension of observation vector + obs_op_pdaf, & ! Observation operator + prodRinvA_pdaf, & ! Provide product R^-1 A + cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix + obs_op_lin_pdaf, & ! Linearized observation operator + obs_op_adj_pdaf ! Adjoint observation operator + END SUBROUTINE PDAFomi_put_state_en3dvar_estkf_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFomi_put_state_en3dvar_lestkf(collect_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & + init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdaf, & + g2l_state_pdaf, l2g_state_pdaf, prepoststep_pdaf, outflag) + INTEGER, INTENT(inout) :: outflag ! Status flag + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector prepoststep_pdaf ! User supplied pre/poststep routine EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix @@ -1598,17 +2249,34 @@ SUBROUTINE PDAFomi_put_state_en3dvar_lestkf(collect_state_pdaf, & init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector obs_op_f_pdaf, & ! Full observation operator init_dim_obs_l_pdaf ! Initialize local dimimension of obs. vector - EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector - PDAFomi_init_obs_l_cb, & ! Initialize local observation vector - PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance - PDAFomi_init_obsvar_l_cb, & ! Initialize local mean observation error variance - PDAFomi_prodRinvA_cb, & ! Provide product R^-1 A - PDAFomi_g2l_obs_cb, & ! Restrict full obs. vector to local analysis domain - PDAFomi_prodRinvA_l_cb, & ! Provide product R^-1 A on local analysis domain - PDAFomi_likelihood_l_cb ! Compute likelihood and apply localization END SUBROUTINE PDAFomi_put_state_en3dvar_lestkf END INTERFACE + INTERFACE + SUBROUTINE PDAFomi_put_state_en3dvar_lestkf_nondiagR(collect_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, prodRinvA_pdaf, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & + prodRinvA_l_pdaf, init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdaf, & + g2l_state_pdaf, l2g_state_pdaf, prepoststep_pdaf, outflag) + INTEGER, INTENT(inout) :: outflag ! Status flag + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix + obs_op_lin_pdaf, & ! Linearized observation operator + obs_op_adj_pdaf ! Adjoint observation operator + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + prodRinvA_pdaf, & ! Provide product R^-1 A + g2l_state_pdaf, & ! Get state on local ana. domain from full state + l2g_state_pdaf, & ! Init full state from local state + init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector + obs_op_f_pdaf, & ! Full observation operator + init_dim_obs_l_pdaf, & ! Initialize local dimimension of obs. vector + prodRinvA_l_pdaf ! Provide product R^-1 A with localization + END SUBROUTINE PDAFomi_put_state_en3dvar_lestkf_nondiagR + END INTERFACE + INTERFACE SUBROUTINE PDAFomi_put_state_hyb3dvar_estkf(collect_state_pdaf, & init_dim_obs_pdaf, obs_op_pdaf, & @@ -1625,15 +2293,29 @@ SUBROUTINE PDAFomi_put_state_hyb3dvar_estkf(collect_state_pdaf, & cvt_adj_ens_pdaf, & ! Apply adjoint ensemble control vector transform matrix obs_op_lin_pdaf, & ! Linearized observation operator obs_op_adj_pdaf ! Adjoint observation operator - EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector - PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance - PDAFomi_init_obscovar_cb, & ! Initialize mean observation error variance - PDAFomi_add_obs_error_cb, & ! Add observation error covariance matrix - PDAFomi_prodRinvA_cb, & ! Provide product R^-1 A - PDAFomi_likelihood_cb ! Compute likelihood END SUBROUTINE PDAFomi_put_state_hyb3dvar_estkf END INTERFACE + INTERFACE + SUBROUTINE PDAFomi_put_state_hyb3dvar_estkf_nondiagR(collect_state_pdaf, & + init_dim_obs_pdaf, obs_op_pdaf, prodRinvA_pdaf, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, cvt_pdaf, cvt_adj_pdaf, & + obs_op_lin_pdaf, obs_op_adj_pdaf, prepoststep_pdaf, outflag) + INTEGER, INTENT(inout) :: outflag ! Status flag + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_dim_obs_pdaf, & ! Initialize dimension of observation vector + obs_op_pdaf, & ! Observation operator + prodRinvA_pdaf, & ! Provide product R^-1 A + cvt_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_pdaf, & ! Apply adjoint control vector transform matrix + cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix + obs_op_lin_pdaf, & ! Linearized observation operator + obs_op_adj_pdaf ! Adjoint observation operator + END SUBROUTINE PDAFomi_put_state_hyb3dvar_estkf_nondiagR + END INTERFACE + INTERFACE SUBROUTINE PDAFomi_put_state_hyb3dvar_lestkf(collect_state_pdaf, & init_dim_obs_f_pdaf, obs_op_f_pdaf, & @@ -1656,161 +2338,34 @@ SUBROUTINE PDAFomi_put_state_hyb3dvar_lestkf(collect_state_pdaf, & init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector obs_op_f_pdaf, & ! Full observation operator init_dim_obs_l_pdaf ! Initialize local dimimension of obs. vector - EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector - PDAFomi_init_obs_l_cb, & ! Initialize local observation vector - PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance - PDAFomi_init_obsvar_l_cb, & ! Initialize local mean observation error variance - PDAFomi_prodRinvA_cb, & ! Provide product R^-1 A - PDAFomi_g2l_obs_cb, & ! Restrict full obs. vector to local analysis domain - PDAFomi_prodRinvA_l_cb, & ! Provide product R^-1 A on local analysis domain - PDAFomi_likelihood_l_cb ! Compute likelihood and apply localization END SUBROUTINE PDAFomi_put_state_hyb3dvar_lestkf END INTERFACE INTERFACE - SUBROUTINE PDAF_put_state_3dvar(U_collect_state, & - U_init_dim_obs, U_obs_op, U_init_obs, U_prodRinvA, & - U_cvt, U_cvt_adj, U_obs_op_lin, U_obs_op_adj, & - U_prepoststep, outflag) - INTEGER, INTENT(out) :: outflag ! Status flag - EXTERNAL :: U_collect_state, & ! Routine to collect a state vector - U_init_dim_obs, & ! Initialize dimension of observation vector - U_obs_op, & ! Observation operator - U_init_obsvar, & ! Initialize mean observation error variance - U_init_obs, & ! Initialize observation vector - U_prepoststep, & ! User supplied pre/poststep routine - U_prodRinvA, & ! Provide product R^-1 A - U_cvt, & ! Apply control vector transform matrix to control vector - U_cvt_adj, & ! Apply adjoint control vector transform matrix - U_obs_op_lin, & ! Linearized observation operator - U_obs_op_adj ! Adjoint observation operator - END SUBROUTINE PDAF_put_state_3dvar - END INTERFACE - - INTERFACE - SUBROUTINE PDAF_put_state_en3dvar_estkf(U_collect_state, & - U_init_dim_obs, U_obs_op, U_init_obs, U_prodRinvA, & - U_cvt_ens, U_cvt_adj_ens, U_obs_op_lin, U_obs_op_adj, & - U_init_obsvar, U_prepoststep, outflag) - INTEGER, INTENT(out) :: outflag ! Status flag - EXTERNAL :: U_collect_state, & ! Routine to collect a state vector - U_init_dim_obs, & ! Initialize dimension of observation vector - U_obs_op, & ! Observation operator - U_init_obs, & ! Initialize observation vector - U_prepoststep, & ! User supplied pre/poststep routine - U_prodRinvA, & ! Provide product R^-1 A - U_cvt_ens, & ! Apply control vector transform matrix (ensemble) - U_cvt_adj_ens, & ! Apply adjoint control vector transform matrix (ensemble var) - U_obs_op_lin, & ! Linearized observation operator - U_obs_op_adj ! Adjoint observation operator - EXTERNAL :: U_init_obsvar ! Initialize mean observation error variance - END SUBROUTINE PDAF_put_state_en3dvar_estkf - END INTERFACE - - INTERFACE - SUBROUTINE PDAF_put_state_en3dvar_lestkf(U_collect_state, U_init_dim_obs, U_obs_op, & - U_init_obs, U_prodRinvA, & - U_cvt_ens, U_cvt_adj_ens, U_obs_op_lin, U_obs_op_adj, & - U_init_dim_obs_f, U_obs_op_f, U_init_obs_f, U_init_obs_l, U_prodRinvA_l, & - U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, U_g2l_state, U_l2g_state, & - U_g2l_obs, U_init_obsvar, U_init_obsvar_l, & - U_prepoststep, outflag) - INTEGER, INTENT(out) :: outflag ! Status flag - EXTERNAL :: U_collect_state, & ! Routine to collect a state vector - U_init_dim_obs, & ! Initialize dimension of observation vector - U_obs_op, & ! Observation operator - U_init_obs, & ! Initialize observation vector - U_prepoststep, & ! User supplied pre/poststep routine - U_prodRinvA, & ! Provide product R^-1 A - U_cvt_ens, & ! Apply control vector transform matrix (ensemble) - U_cvt_adj_ens, & ! Apply adjoint control vector transform matrix (ensemble var) - U_obs_op_lin, & ! Linearized observation operator - U_obs_op_adj ! Adjoint observation operator - EXTERNAL :: U_obs_op_f, & ! Observation operator - U_init_n_domains_p, & ! Provide number of local analysis domains - U_init_dim_l, & ! Init state dimension for local ana. domain - U_init_dim_obs_f, & ! Initialize dimension of observation vector - U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain - U_init_obs_f, & ! Initialize PE-local observation vector - U_init_obs_l, & ! Init. observation vector on local analysis domain - U_init_obsvar, & ! Initialize mean observation error variance - U_init_obsvar_l, & ! Initialize local mean observation error variance - U_g2l_state, & ! Get state on local ana. domain from full state - U_l2g_state, & ! Init full state from state on local analysis domain - U_g2l_obs, & ! Restrict full obs. vector to local analysis domain - U_prodRinvA_l ! Provide product R^-1 A on local analysis domain - END SUBROUTINE PDAF_put_state_en3dvar_lestkf - END INTERFACE - - INTERFACE - SUBROUTINE PDAF_put_state_hyb3dvar_estkf(U_collect_state, U_init_dim_obs, U_obs_op, & - U_init_obs, U_prodRinvA, & - U_cvt, U_cvt_adj, U_cvt_ens, U_cvt_adj_ens, U_obs_op_lin, U_obs_op_adj, & - U_init_obsvar, U_prepoststep, outflag) - INTEGER, INTENT(out) :: outflag ! Status flag - EXTERNAL :: U_collect_state, & ! Routine to collect a state vector - U_init_dim_obs, & ! Initialize dimension of observation vector - U_obs_op, & ! Observation operator - U_init_obs, & ! Initialize observation vector - U_prepoststep, & ! User supplied pre/poststep routine - U_prodRinvA, & ! Provide product R^-1 A - U_cvt_ens, & ! Apply control vector transform matrix (ensemble) - U_cvt_adj_ens, & ! Apply adjoint control vector transform matrix (ensemble var) - U_cvt, & ! Apply control vector transform matrix to control vector - U_cvt_adj, & ! Apply adjoint control vector transform matrix - U_obs_op_lin, & ! Linearized observation operator - U_obs_op_adj ! Adjoint observation operator - EXTERNAL :: U_init_obsvar ! Initialize mean observation error variance - END SUBROUTINE PDAF_put_state_hyb3dvar_estkf - END INTERFACE - - INTERFACE - SUBROUTINE PDAF_put_state_hyb3dvar_lestkf(U_collect_state, & - U_init_dim_obs, U_obs_op, U_init_obs, U_prodRinvA, & - U_cvt_ens, U_cvt_adj_ens, U_cvt, U_cvt_adj, U_obs_op_lin, U_obs_op_adj, & - U_init_dim_obs_f, U_obs_op_f, U_init_obs_f, U_init_obs_l, U_prodRinvA_l, & - U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, U_g2l_state, U_l2g_state, & - U_g2l_obs, U_init_obsvar, U_init_obsvar_l, & - U_prepoststep, outflag) - INTEGER, INTENT(out) :: outflag ! Status flag - EXTERNAL :: U_collect_state, & ! Routine to collect a state vector - U_init_dim_obs, & ! Initialize dimension of observation vector - U_obs_op, & ! Observation operator - U_init_obs, & ! Initialize observation vector - U_prepoststep, & ! User supplied pre/poststep routine - U_prodRinvA, & ! Provide product R^-1 A - U_cvt_ens, & ! Apply control vector transform matrix (ensemble) - U_cvt_adj_ens, & ! Apply adjoint control vector transform matrix (ensemble var) - U_cvt, & ! Apply control vector transform matrix to control vector - U_cvt_adj, & ! Apply adjoint control vector transform matrix - U_obs_op_lin, & ! Linearized observation operator - U_obs_op_adj ! Adjoint observation operator - EXTERNAL :: U_obs_op_f, & ! Observation operator - U_init_n_domains_p, & ! Provide number of local analysis domains - U_init_dim_l, & ! Init state dimension for local ana. domain - U_init_dim_obs_f, & ! Initialize dimension of observation vector - U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain - U_init_obs_f, & ! Initialize PE-local observation vector - U_init_obs_l, & ! Init. observation vector on local analysis domain - U_init_obsvar, & ! Initialize mean observation error variance - U_init_obsvar_l, & ! Initialize local mean observation error variance - U_g2l_state, & ! Get state on local ana. domain from full state - U_l2g_state, & ! Init full state from state on local analysis domain - U_g2l_obs, & ! Restrict full obs. vector to local analysis domain - U_prodRinvA_l ! Provide product R^-1 A on local analysis domain - END SUBROUTINE PDAF_put_state_hyb3dvar_lestkf - END INTERFACE - - INTERFACE - SUBROUTINE PDAF_set_debug_flag(debugval) - INTEGER, INTENT(in) :: debugval ! Value of debugging flag; print debug information for >0 - END SUBROUTINE PDAF_set_debug_flag - END INTERFACE - - INTERFACE - SUBROUTINE PDAF_set_offline_mode(screen) - INTEGER, INTENT(in) :: screen ! Verbosity flag - END SUBROUTINE PDAF_set_offline_mode + SUBROUTINE PDAFomi_put_state_hyb3dvar_lestkf_nondiagR(collect_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, prodRinvA_pdaf, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & + prodRinvA_l_pdaf, init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdaf, & + g2l_state_pdaf, l2g_state_pdaf, prepoststep_pdaf, outflag) + INTEGER, INTENT(inout) :: outflag ! Status flag + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix + cvt_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_pdaf, & ! Apply adjoint control vector transform matrix + obs_op_lin_pdaf, & ! Linearized observation operator + obs_op_adj_pdaf ! Adjoint observation operator + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + prodRinvA_pdaf, & ! Provide product R^-1 A + g2l_state_pdaf, & ! Get state on local ana. domain from full state + l2g_state_pdaf, & ! Init full state from local state + init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector + obs_op_f_pdaf, & ! Full observation operator + init_dim_obs_l_pdaf, & ! Initialize local dimimension of obs. vector + prodRinvA_l_pdaf ! Provide product R^-1 A with localization + END SUBROUTINE PDAFomi_put_state_hyb3dvar_lestkf_nondiagR END INTERFACE END MODULE PDAF_interfaces_module diff --git a/src/PDAF_lestkf_analysis.F90 b/src/PDAF_lestkf_analysis.F90 index d3d582024..3f273abe3 100644 --- a/src/PDAF_lestkf_analysis.F90 +++ b/src/PDAF_lestkf_analysis.F90 @@ -572,7 +572,7 @@ SUBROUTINE PDAF_lestkf_analysis(domain_p, step, dim_l, dim_obs_f, dim_obs_l, & OmegaT = OmegaT_in ! A = (Omega C^(-1)) by solving Ct A = OmegaT for A - CALL trtrsTYPE('l', 't', 'n', rank, dim_ens, & + CALL trtrsTYPE('L', 'T', 'N', rank, dim_ens, & tmp_Ainv_l, rank, OmegaT, rank, lib_info) ELSE ! TEMP_AINV already contains matrix C (no more inversion) diff --git a/src/PDAF_lestkf_memtime.F90 b/src/PDAF_lestkf_memtime.F90 index e87014047..7db57178d 100644 --- a/src/PDAF_lestkf_memtime.F90 +++ b/src/PDAF_lestkf_memtime.F90 @@ -45,6 +45,8 @@ SUBROUTINE PDAF_lestkf_memtime(printtype) ONLY: filterpe, mype_world, COMM_pdaf USE PDAFomi, & ONLY: omi_was_used + USE PDAFlocal, & + ONLY: pdaflocal_was_used IMPLICIT NONE @@ -138,9 +140,10 @@ SUBROUTINE PDAF_lestkf_memtime(printtype) time_omi, 's' WRITE (*, '(a, 12x, a, 11x, F11.3, 1x, a)') 'PDAF', 'init_n_domains_pdaf:', pdaf_time_tot(42), 's' WRITE (*, '(a, 12x, a, 15x, F11.3, 1x, a)') 'PDAF', 'init_dim_l_pdaf:', pdaf_time_tot(45), 's' - WRITE (*, '(a, 12x, a, 16x, F11.3, 1x, a)') 'PDAF', 'g2l_state_pdaf:', pdaf_time_tot(15), 's' - WRITE (*, '(a, 12x, a, 16x, F11.3, 1x, a)') 'PDAF', 'l2g_state_pdaf:', pdaf_time_tot(16), 's' - + IF (.NOT.pdaflocal_was_used) THEN + WRITE (*, '(a, 12x, a, 16x, F11.3, 1x, a)') 'PDAF', 'g2l_state_pdaf:', pdaf_time_tot(15), 's' + WRITE (*, '(a, 12x, a, 16x, F11.3, 1x, a)') 'PDAF', 'l2g_state_pdaf:', pdaf_time_tot(16), 's' + END IF WRITE (*, '(a, 12x, a)') 'PDAF', 'Time in OMI observation module routines ' WRITE (*, '(a, 14x, a, 8x, F11.3, 1x, a)') 'PDAF', 'init_dim_obs_pdafomi:', pdaf_time_tot(43), 's' WRITE (*, '(a, 14x, a, 14x, F11.3, 1x, a)') 'PDAF', 'obs_op_pdafomi:', pdaf_time_tot(44), 's' diff --git a/src/PDAF_letkf_memtime.F90 b/src/PDAF_letkf_memtime.F90 index 4449b285a..8814fb2ce 100644 --- a/src/PDAF_letkf_memtime.F90 +++ b/src/PDAF_letkf_memtime.F90 @@ -45,6 +45,8 @@ SUBROUTINE PDAF_letkf_memtime(printtype) ONLY: filterpe, mype_world, COMM_pdaf USE PDAFomi, & ONLY: omi_was_used + USE PDAFlocal, & + ONLY: pdaflocal_was_used IMPLICIT NONE @@ -138,9 +140,10 @@ SUBROUTINE PDAF_letkf_memtime(printtype) time_omi, 's' WRITE (*, '(a, 12x, a, 11x, F11.3, 1x, a)') 'PDAF', 'init_n_domains_pdaf:', pdaf_time_tot(42), 's' WRITE (*, '(a, 12x, a, 15x, F11.3, 1x, a)') 'PDAF', 'init_dim_l_pdaf:', pdaf_time_tot(45), 's' - WRITE (*, '(a, 12x, a, 16x, F11.3, 1x, a)') 'PDAF', 'g2l_state_pdaf:', pdaf_time_tot(15), 's' - WRITE (*, '(a, 12x, a, 16x, F11.3, 1x, a)') 'PDAF', 'l2g_state_pdaf:', pdaf_time_tot(16), 's' - + IF (.NOT.pdaflocal_was_used) THEN + WRITE (*, '(a, 12x, a, 16x, F11.3, 1x, a)') 'PDAF', 'g2l_state_pdaf:', pdaf_time_tot(15), 's' + WRITE (*, '(a, 12x, a, 16x, F11.3, 1x, a)') 'PDAF', 'l2g_state_pdaf:', pdaf_time_tot(16), 's' + END IF WRITE (*, '(a, 12x, a)') 'PDAF', 'Time in OMI observation module routines ' WRITE (*, '(a, 14x, a, 8x, F11.3, 1x, a)') 'PDAF', 'init_dim_obs_pdafomi:', pdaf_time_tot(43), 's' WRITE (*, '(a, 14x, a, 14x, F11.3, 1x, a)') 'PDAF', 'obs_op_pdafomi:', pdaf_time_tot(44), 's' diff --git a/src/PDAF_lknetf_memtime.F90 b/src/PDAF_lknetf_memtime.F90 index c2c096fd9..a0519414a 100644 --- a/src/PDAF_lknetf_memtime.F90 +++ b/src/PDAF_lknetf_memtime.F90 @@ -45,6 +45,8 @@ SUBROUTINE PDAF_lknetf_memtime(printtype) ONLY: filterpe, mype_world, COMM_pdaf USE PDAFomi, & ONLY: omi_was_used + USE PDAFlocal, & + ONLY: pdaflocal_was_used IMPLICIT NONE @@ -138,9 +140,10 @@ SUBROUTINE PDAF_lknetf_memtime(printtype) time_omi, 's' WRITE (*, '(a, 12x, a, 11x, F11.3, 1x, a)') 'PDAF', 'init_n_domains_pdaf:', pdaf_time_tot(42), 's' WRITE (*, '(a, 12x, a, 15x, F11.3, 1x, a)') 'PDAF', 'init_dim_l_pdaf:', pdaf_time_tot(45), 's' - WRITE (*, '(a, 12x, a, 16x, F11.3, 1x, a)') 'PDAF', 'g2l_state_pdaf:', pdaf_time_tot(15), 's' - WRITE (*, '(a, 12x, a, 16x, F11.3, 1x, a)') 'PDAF', 'l2g_state_pdaf:', pdaf_time_tot(16), 's' - + IF (.NOT.pdaflocal_was_used) THEN + WRITE (*, '(a, 12x, a, 16x, F11.3, 1x, a)') 'PDAF', 'g2l_state_pdaf:', pdaf_time_tot(15), 's' + WRITE (*, '(a, 12x, a, 16x, F11.3, 1x, a)') 'PDAF', 'l2g_state_pdaf:', pdaf_time_tot(16), 's' + END IF WRITE (*, '(a, 12x, a)') 'PDAF', 'Time in OMI observation module routines ' WRITE (*, '(a, 14x, a, 8x, F11.3, 1x, a)') 'PDAF', 'init_dim_obs_pdafomi:', pdaf_time_tot(43), 's' WRITE (*, '(a, 14x, a, 14x, F11.3, 1x, a)') 'PDAF', 'obs_op_pdafomi:', pdaf_time_tot(44), 's' diff --git a/src/PDAF_lnetf_memtime.F90 b/src/PDAF_lnetf_memtime.F90 index 3fe415c54..d2ecdf680 100644 --- a/src/PDAF_lnetf_memtime.F90 +++ b/src/PDAF_lnetf_memtime.F90 @@ -45,6 +45,8 @@ SUBROUTINE PDAF_lnetf_memtime(printtype) ONLY: filterpe, mype_world, COMM_pdaf USE PDAFomi, & ONLY: omi_was_used + USE PDAFlocal, & + ONLY: pdaflocal_was_used IMPLICIT NONE @@ -137,9 +139,10 @@ SUBROUTINE PDAF_lnetf_memtime(printtype) time_omi, 's' WRITE (*, '(a, 12x, a, 11x, F11.3, 1x, a)') 'PDAF', 'init_n_domains_pdaf:', pdaf_time_tot(42), 's' WRITE (*, '(a, 12x, a, 15x, F11.3, 1x, a)') 'PDAF', 'init_dim_l_pdaf:', pdaf_time_tot(45), 's' - WRITE (*, '(a, 12x, a, 16x, F11.3, 1x, a)') 'PDAF', 'g2l_state_pdaf:', pdaf_time_tot(15), 's' - WRITE (*, '(a, 12x, a, 16x, F11.3, 1x, a)') 'PDAF', 'l2g_state_pdaf:', pdaf_time_tot(16), 's' - + IF (.NOT.pdaflocal_was_used) THEN + WRITE (*, '(a, 12x, a, 16x, F11.3, 1x, a)') 'PDAF', 'g2l_state_pdaf:', pdaf_time_tot(15), 's' + WRITE (*, '(a, 12x, a, 16x, F11.3, 1x, a)') 'PDAF', 'l2g_state_pdaf:', pdaf_time_tot(16), 's' + END IF WRITE (*, '(a, 12x, a)') 'PDAF', 'Time in OMI observation module routines ' WRITE (*, '(a, 14x, a, 8x, F11.3, 1x, a)') 'PDAF', 'init_dim_obs_pdafomi:', pdaf_time_tot(43), 's' WRITE (*, '(a, 14x, a, 14x, F11.3, 1x, a)') 'PDAF', 'obs_op_pdafomi:', pdaf_time_tot(44), 's' diff --git a/src/PDAF_local_weight.F90 b/src/PDAF_local_weight.F90 index 54747515c..a7a5cb724 100644 --- a/src/PDAF_local_weight.F90 +++ b/src/PDAF_local_weight.F90 @@ -154,18 +154,26 @@ SUBROUTINE PDAF_local_weight(wtype, rtype, cradius, sradius, distance, & cradnull: IF (cradius > 0.0 .and. sradius > 0.0) THEN cutoff: IF (distance <= cradius) THEN - IF (distance <= sradius / 2) THEN + IF (distance <= sradius / 2.0) THEN weight = -0.25 * (distance / cfaci)**5 & + 0.5 * (distance / cfaci)**4 & + 5.0 / 8.0 * (distance / cfaci)**3 & - 5.0 / 3.0 * (distance / cfaci)**2 + 1.0 - ELSEIF (distance > sradius / 2 .AND. distance < sradius) THEN + ELSEIF (distance > sradius / 2.0 .AND. distance < sradius * 0.9) THEN weight = 1.0 / 12.0 * (distance / cfaci)**5 & - 0.5 * (distance / cfaci)**4 & + 5.0 / 8.0 * (distance / cfaci)**3 & + 5.0 / 3.0 * (distance / cfaci)**2 & - 5.0 * (distance / cfaci) & + 4.0 - 2.0 / 3.0 * cfaci / distance + ELSEIF (distance >= sradius * 0.9 .AND. distance < sradius) THEN + ! Ensure that weight is non-negative + weight = MAX(1.0 / 12.0 * (distance / cfaci)**5 & + - 0.5 * (distance / cfaci)**4 & + + 5.0 / 8.0 * (distance / cfaci)**3 & + + 5.0 / 3.0 * (distance / cfaci)**2 & + - 5.0 * (distance / cfaci) & + + 4.0 - 2.0 / 3.0 * cfaci / distance, 0.0) ELSE weight = 0.0 ENDIF diff --git a/src/PDAF_lseik_analysis_trans.F90 b/src/PDAF_lseik_analysis_trans.F90 index f4e0fadc2..8fe291ce0 100644 --- a/src/PDAF_lseik_analysis_trans.F90 +++ b/src/PDAF_lseik_analysis_trans.F90 @@ -577,7 +577,7 @@ SUBROUTINE PDAF_lseik_analysis_trans(domain_p, step, dim_l, dim_obs_f, dim_obs_l OmegaT = OmegaT_in ! A = (Omega C^(-1)) by solving Ct A = OmegaT for A - CALL trtrsTYPE('l', 't', 'n', rank, dim_ens, & + CALL trtrsTYPE('L', 'T', 'N', rank, dim_ens, & tmp_Uinv_l, rank, OmegaT, rank, lib_info) ELSE ! TEMP_UINV already contains matrix C (no more inversion) diff --git a/src/PDAF_lseik_memtime.F90 b/src/PDAF_lseik_memtime.F90 index f15fac364..8b398b056 100644 --- a/src/PDAF_lseik_memtime.F90 +++ b/src/PDAF_lseik_memtime.F90 @@ -45,6 +45,8 @@ SUBROUTINE PDAF_lseik_memtime(printtype) ONLY: filterpe, mype_world, COMM_pdaf USE PDAFomi, & ONLY: omi_was_used + USE PDAFlocal, & + ONLY: pdaflocal_was_used IMPLICIT NONE @@ -137,9 +139,10 @@ SUBROUTINE PDAF_lseik_memtime(printtype) time_omi, 's' WRITE (*, '(a, 12x, a, 11x, F11.3, 1x, a)') 'PDAF', 'init_n_domains_pdaf:', pdaf_time_tot(42), 's' WRITE (*, '(a, 12x, a, 15x, F11.3, 1x, a)') 'PDAF', 'init_dim_l_pdaf:', pdaf_time_tot(45), 's' - WRITE (*, '(a, 12x, a, 16x, F11.3, 1x, a)') 'PDAF', 'g2l_state_pdaf:', pdaf_time_tot(15), 's' - WRITE (*, '(a, 12x, a, 16x, F11.3, 1x, a)') 'PDAF', 'l2g_state_pdaf:', pdaf_time_tot(16), 's' - + IF (.NOT.pdaflocal_was_used) THEN + WRITE (*, '(a, 12x, a, 16x, F11.3, 1x, a)') 'PDAF', 'g2l_state_pdaf:', pdaf_time_tot(15), 's' + WRITE (*, '(a, 12x, a, 16x, F11.3, 1x, a)') 'PDAF', 'l2g_state_pdaf:', pdaf_time_tot(16), 's' + END IF WRITE (*, '(a, 12x, a)') 'PDAF', 'Time in OMI observation module routines' WRITE (*, '(a, 14x, a, 8x, F11.3, 1x, a)') 'PDAF', 'init_dim_obs_pdafomi:', pdaf_time_tot(43), 's' WRITE (*, '(a, 14x, a, 14x, F11.3, 1x, a)') 'PDAF', 'obs_op_pdafomi:', pdaf_time_tot(44), 's' diff --git a/src/PDAF_lseik_resample.F90 b/src/PDAF_lseik_resample.F90 index 16af312c3..10999029a 100644 --- a/src/PDAF_lseik_resample.F90 +++ b/src/PDAF_lseik_resample.F90 @@ -273,7 +273,7 @@ SUBROUTINE PDAF_lseik_resample(domain_p, subtype, dim_l, dim_ens, & OmegaT = OmegaT_in ! A = (Omega C^(-1)) by solving Ct A = OmegaT for A - CALL trtrsTYPE('l', 't', 'n', rank, dim_ens, & + CALL trtrsTYPE('L', 'T', 'N', rank, dim_ens, & tmpUinv_l, rank, OmegaT, rank, lib_info) ELSE ! TMP_UINV already contains matrix C (no more inversion) diff --git a/src/PDAF_mod_filter.F90 b/src/PDAF_mod_filter.F90 index f4b5fdc07..1bb346b86 100644 --- a/src/PDAF_mod_filter.F90 +++ b/src/PDAF_mod_filter.F90 @@ -100,9 +100,9 @@ MODULE PDAF_mod_filter INTEGER :: step ! Current time step INTEGER :: step_obs ! Time step of next observation INTEGER :: dim_obs ! Dimension of next observation - INTEGER :: screen ! Control verbosity of filter routines + INTEGER :: screen=0 ! Control verbosity of filter routines ! (0) quiet; (1) normal output; (2); plus timings; (3) debug output - INTEGER :: debug ! Debugging flag: print debug information if >0 + INTEGER :: debug=0 ! Debugging flag: print debug information if >0 INTEGER :: incremental=0 ! Whether to perform incremental updating INTEGER :: type_forget=0 ! Type of forgetting factor ! (0): fixed; (1) global adaptive; (2) local adaptive diff --git a/src/PDAF_print_version.F90 b/src/PDAF_print_version.F90 index 08e2655b9..2b587f4d9 100644 --- a/src/PDAF_print_version.F90 +++ b/src/PDAF_print_version.F90 @@ -56,7 +56,7 @@ SUBROUTINE PDAF_print_version() WRITE(*, '(a)') 'PDAF +++ PDAF +++' WRITE(*, '(a)') 'PDAF +++ Parallel Data Assimilation Framework +++' WRITE(*, '(a)') 'PDAF +++ +++' - WRITE(*, '(a)') 'PDAF +++ Version 2.2.1 +++' + WRITE(*, '(a)') 'PDAF +++ Version 2.3 +++' WRITE(*, '(a)') 'PDAF +++ +++' WRITE(*, '(a)') 'PDAF +++ Please cite +++' WRITE(*, '(a)') 'PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++' diff --git a/src/PDAF_seik_analysis.F90 b/src/PDAF_seik_analysis.F90 index 5f12713f8..1da78c9c2 100644 --- a/src/PDAF_seik_analysis.F90 +++ b/src/PDAF_seik_analysis.F90 @@ -256,6 +256,34 @@ SUBROUTINE PDAF_seik_analysis(step, dim_p, dim_obs_p, dim_ens, rank, & CALL PDAF_timeit(51, 'old') END IF + ELSE IF (dim_obs_p == 0) THEN + + ! For OMI we need to call observation operator also for dim_obs_p=0 + ! in order to initialize the pointer to the observation types + ! Further the observation operator has to be executed in cases + ! in which the operation include a global communication + IF (.NOT.observe_ens) THEN + IF (omi_n_obstypes>0) THEN + ALLOCATE(m_state_p(1)) + obs_member = 0 + + ! [Hx_1 ... Hx_N] + CALL U_obs_op(step, dim_p, dim_obs_p, state_p, m_state_p) + + DEALLOCATE(m_state_p) + ELSE + ALLOCATE(HL_p(1,1)) + DO member = 1, dim_ens + ! Store member index to make it accessible with PDAF_get_obsmemberid + obs_member = member + + ! [Hx_1 ... Hx_N] + CALL U_obs_op(step, dim_p, dim_obs_p, ens_p(:, member), HL_p(:, member)) + END DO + DEALLOCATE(HL_p) + END IF + END IF + END IF haveobsB CALL PDAF_timeit(12, 'old') @@ -369,15 +397,21 @@ SUBROUTINE PDAF_seik_analysis(step, dim_p, dim_obs_p, dim_ens, rank, & Uinv_p = 0.0 ! For OMI we need to call observation operator also for dim_obs_p=0 - ! in order to initialize pointer to observation type + ! in order to initialize the pointer to the observation types + ! Further the observation operator has to be executed in cases + ! in which the operation includes a global communication IF (omi_n_obstypes>0) THEN - ALLOCATE(HL_p(1, 1)) - obs_member = 1 - - ! [Hx_1 ... Hx_N] - CALL U_obs_op(step, dim_p, dim_obs_p, ens_p(:, 1), HL_p(:, 1)) - - DEALLOCATE(HL_p) + IF (.NOT.observe_ens) THEN + ALLOCATE(HL_p(1,1)) + DO member = 1, dim_ens + ! Store member index to make it accessible with PDAF_get_obsmemberid + obs_member = member + + ! [Hx_1 ... Hx_N] + CALL U_obs_op(step, dim_p, dim_obs_p, ens_p(:, member), HL_p(:, member)) + END DO + DEALLOCATE(HL_p) + END IF END IF END IF haveobsA diff --git a/src/PDAF_seik_analysis_newT.F90 b/src/PDAF_seik_analysis_newT.F90 index 3520c2753..1c22d2366 100644 --- a/src/PDAF_seik_analysis_newT.F90 +++ b/src/PDAF_seik_analysis_newT.F90 @@ -257,6 +257,34 @@ SUBROUTINE PDAF_seik_analysis_newT(step, dim_p, dim_obs_p, dim_ens, rank, & CALL PDAF_timeit(51, 'old') END IF + ELSE IF (dim_obs_p == 0) THEN + + ! For OMI we need to call observation operator also for dim_obs_p=0 + ! in order to initialize the pointer to the observation types + ! Further the observation operator has to be executed in cases + ! in which the operation include a global communication + IF (.NOT.observe_ens) THEN + IF (omi_n_obstypes>0) THEN + ALLOCATE(m_state_p(1)) + obs_member = 0 + + ! [Hx_1 ... Hx_N] + CALL U_obs_op(step, dim_p, dim_obs_p, state_p, m_state_p) + + DEALLOCATE(m_state_p) + ELSE + ALLOCATE(HL_p(1,1)) + DO member = 1, dim_ens + ! Store member index to make it accessible with PDAF_get_obsmemberid + obs_member = member + + ! [Hx_1 ... Hx_N] + CALL U_obs_op(step, dim_p, dim_obs_p, ens_p(:, member), HL_p(:, member)) + END DO + DEALLOCATE(HL_p) + END IF + END IF + END IF haveobsB CALL PDAF_timeit(12, 'old') @@ -370,15 +398,21 @@ SUBROUTINE PDAF_seik_analysis_newT(step, dim_p, dim_obs_p, dim_ens, rank, & Uinv_p = 0.0 ! For OMI we need to call observation operator also for dim_obs_p=0 - ! in order to initialize pointer to observation type + ! in order to initialize the pointer to the observation types + ! Further the observation operator has to be executed in cases + ! in which the operation includes a global communication IF (omi_n_obstypes>0) THEN - ALLOCATE(HL_p(1, 1)) - obs_member = 1 - - ! [Hx_1 ... Hx_N] - CALL U_obs_op(step, dim_p, dim_obs_p, ens_p(:, 1), HL_p(:, 1)) - - DEALLOCATE(HL_p) + IF (.NOT.observe_ens) THEN + ALLOCATE(HL_p(1,1)) + DO member = 1, dim_ens + ! Store member index to make it accessible with PDAF_get_obsmemberid + obs_member = member + + ! [Hx_1 ... Hx_N] + CALL U_obs_op(step, dim_p, dim_obs_p, ens_p(:, member), HL_p(:, member)) + END DO + DEALLOCATE(HL_p) + END IF END IF END IF haveobsA diff --git a/src/PDAF_seik_analysis_trans.F90 b/src/PDAF_seik_analysis_trans.F90 index d424a2756..25fd47aa4 100644 --- a/src/PDAF_seik_analysis_trans.F90 +++ b/src/PDAF_seik_analysis_trans.F90 @@ -287,6 +287,34 @@ SUBROUTINE PDAF_seik_analysis_trans(step, dim_p, dim_obs_p, dim_ens, rank, & CALL PDAF_timeit(51, 'old') END IF + ELSE IF (dim_obs_p == 0) THEN + + ! For OMI we need to call observation operator also for dim_obs_p=0 + ! in order to initialize the pointer to the observation types + ! Further the observation operator has to be executed in cases + ! in which the operation include a global communication + IF (.NOT.observe_ens) THEN + IF (omi_n_obstypes>0) THEN + ALLOCATE(HXbar_p(1)) + obs_member = 0 + + ! [Hx_1 ... Hx_N] + CALL U_obs_op(step, dim_p, dim_obs_p, state_p, HXbar_p) + + DEALLOCATE(HXbar_p) + ELSE + ALLOCATE(HL_p(1,1)) + DO member = 1, dim_ens + ! Store member index to make it accessible with PDAF_get_obsmemberid + obs_member = member + + ! [Hx_1 ... Hx_N] + CALL U_obs_op(step, dim_p, dim_obs_p, ens_p(:, member), HL_p(:, member)) + END DO + DEALLOCATE(HL_p) + END IF + END IF + END IF haveobsB CALL PDAF_timeit(12, 'old') @@ -402,15 +430,21 @@ SUBROUTINE PDAF_seik_analysis_trans(step, dim_p, dim_obs_p, dim_ens, rank, & Uinv_p = 0.0 ! For OMI we need to call observation operator also for dim_obs_p=0 - ! in order to initialize pointer to observation type + ! in order to initialize the pointer to the observation types + ! Further the observation operator has to be executed in cases + ! in which the operation includes a global communication IF (omi_n_obstypes>0) THEN - ALLOCATE(HL_p(1, 1)) - obs_member = 1 - - ! [Hx_1 ... Hx_N] - CALL U_obs_op(step, dim_p, dim_obs_p, ens_p(:, 1), HL_p(:, 1)) - - DEALLOCATE(HL_p) + IF (.NOT.observe_ens) THEN + ALLOCATE(HL_p(1,1)) + DO member = 1, dim_ens + ! Store member index to make it accessible with PDAF_get_obsmemberid + obs_member = member + + ! [Hx_1 ... Hx_N] + CALL U_obs_op(step, dim_p, dim_obs_p, ens_p(:, member), HL_p(:, member)) + END DO + DEALLOCATE(HL_p) + END IF END IF END IF haveobsA @@ -719,7 +753,7 @@ SUBROUTINE PDAF_seik_analysis_trans(step, dim_p, dim_obs_p, dim_ens, rank, & CALL PDAF_timeit(34, 'new') IF (type_sqrt == 1) THEN ! A = (Omega C^(-1)) by solving Ct A = OmegaT for A - CALL trtrsTYPE('l', 't', 'n', rank, dim_ens, & + CALL trtrsTYPE('L', 'T', 'N', rank, dim_ens, & tmp_Uinv, rank, OmegaT, rank, lib_info) ELSE ! TMP_UINV already contains matrix C (no more inversion) diff --git a/src/PDAF_seik_resample.F90 b/src/PDAF_seik_resample.F90 index acf944033..69f30f8fa 100644 --- a/src/PDAF_seik_resample.F90 +++ b/src/PDAF_seik_resample.F90 @@ -299,7 +299,7 @@ SUBROUTINE PDAF_seik_resample(subtype, dim_p, dim_ens, rank, Uinv, & CALL PDAF_timeit(34, 'new') IF (type_sqrt == 1) THEN ! A = (Omega C^(-1)) by solving Ct A = OmegaT for A - CALL trtrsTYPE('l', 't', 'n', rank, dim_ens, & + CALL trtrsTYPE('L', 'T', 'N', rank, dim_ens, & tempUinv, rank, OmegaT, rank, lib_info) ELSE ! TMP_UINV already contains matrix C (no more inversion) diff --git a/src/PDAF_seik_resample_newT.F90 b/src/PDAF_seik_resample_newT.F90 index 25581ae39..a47cbfb91 100644 --- a/src/PDAF_seik_resample_newT.F90 +++ b/src/PDAF_seik_resample_newT.F90 @@ -315,7 +315,7 @@ SUBROUTINE PDAF_seik_resample_newT(subtype, dim_p, dim_ens, rank, & CALL PDAF_timeit(34, 'new') IF (type_sqrt == 1) THEN ! A = (Omega C^(-1)) by solving Ct A = OmegaT for A - CALL trtrsTYPE('l', 't', 'n', rank, dim_ens, & + CALL trtrsTYPE('L', 'T', 'N', rank, dim_ens, & tempUinv, rank, OmegaT, rank, lib_info) ELSE ! TMP_UINV already contains matrix C (no more inversion) diff --git a/src/PDAF_timer_mpi.F90 b/src/PDAF_timer_mpi.F90 new file mode 100644 index 000000000..c55c5f6ec --- /dev/null +++ b/src/PDAF_timer_mpi.F90 @@ -0,0 +1,153 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !MODULE: +MODULE PDAF_timer + +! !DESCRIPTION: +! This module provides methods to perform timings of +! parts of a program execution. It uses the intrinsic +! function SYSTEM\_CLOCK. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2000-11 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + SAVE + + PUBLIC :: PDAF_timeit, PDAF_time_tot, PDAF_time_temp +!EOP + + PRIVATE + REAL, ALLOCATABLE :: t_start(:), t_end(:) + REAL, ALLOCATABLE :: t_total(:), t_temp(:) + +CONTAINS +!------------------------------------------------------------------------------- +!BOP +! +! !ROUTINE: PDAF_timeit - Initialize Counters and time regions +! +! !INTERFACE: + SUBROUTINE PDAF_timeit(timerID, operation) + +! !DESCRIPTION: +! Subroutine to initialize counters and to perform timing of a region +! specified by timerID. +! Usage:\\ +! CALL PDAF\_timeit(N,'ini') - Allocates and initializes N counters\\ +! CALL PDAF\_timeit(M,'new') - Start timing region for counter M\\ +! CALL PDAF\_timeit(M,'old') - End timing region for counter M\\ +! CALL PDAF\_timeit(M,'fin') - Finalized and deallocates all counters\\ + +! !USES: + USE mpi + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(in) :: timerID ! ID of timer + CHARACTER(len=3), INTENT(in) :: operation ! Requested operation +!EOP + +!$OMP MASTER + ! Initialize timers + IF (operation == 'ini') THEN + IF ( .NOT. (ALLOCATED(t_start))) THEN + ALLOCATE(t_start(timerID), t_end(timerID)) + ALLOCATE(t_total(timerID), t_temp(timerID)) + END IF + + t_total = 0.0 + END IF + + ! Begin timing region + IF (operation == 'new') THEN + t_start(timerID) = MPI_Wtime() + END IF + + ! End timing region + IF (operation == 'old') THEN + t_end(timerID) = MPI_Wtime() + t_temp(timerID) = t_end(timerID) - t_start(timerID) + t_total(timerID) = t_total(timerID) + t_temp(timerID) + END IF + + ! Finalize timers + IF (operation == 'fin') THEN + DEALLOCATE(t_start, t_end) + DEALLOCATE(t_total, t_temp) + END IF +!$OMP END MASTER + + END SUBROUTINE PDAF_timeit + +!------------------------------------------------------------------------------- +!BOP +! +! !FUNCTION: PDAF_time_temp - Read out timers for last timing interval +! +! !INTERFACE: + REAL FUNCTION PDAF_time_temp(timerID) + +! !DESCRIPTION: +! Read out the value of the timer in seconds for the last +! passage of the timing region defined by timerID. + +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(in) :: timerID ! ID of timer +!EOP + + PDAF_time_temp = t_temp(timerID) + + END FUNCTION PDAF_time_temp + +!------------------------------------------------------------------------------- +!BOP +! +! !FUNCTION: PDAF_time_tot - Read out total time of a timing region. +! +! !INTERFACE: + REAL FUNCTION PDAF_time_tot(timerID) + +! !DESCRIPTION: +! Read out the accumulated value of the timer in seconds +! for the timing region define by timerID. + +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(in) :: timerID ! ID of timer +!EOP + + PDAF_time_tot = t_total(timerID) + + END FUNCTION PDAF_time_tot + +END MODULE PDAF_timer diff --git a/src/PDAFlocal.F90 b/src/PDAFlocal.F90 new file mode 100644 index 000000000..7e70fc7a1 --- /dev/null +++ b/src/PDAFlocal.F90 @@ -0,0 +1,73 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! + +!> PDAF-LOCAL routines handling localization +!! +!! This module contains subroutines that handle the localization of +!! the state vector +!! +!! * PDAFlocal_set_indices \n +!! Set indices of elements of lcoal state vector in global state vector +!! * PDAFlocal_set_increment_weights \n +!! Set optional increment weights applied when upating the lobal state vector +!! from the local analysis state vector +!! * PDAFlocal_clear_increment_weights \n +!! Deallocate vector of increment weights. Afterwards l2g_state is applied without weights +!! +!! __Revision history:__ +!! * 2024-08 - Lars Nerger - Initial code +!! * Later revisions - see repository log +!! +MODULE PDAFlocal + + USE PDAFlocal_interfaces ! Interface defintions for put_state and assimilate routines + + IMPLICIT NONE + SAVE + + INTEGER, ALLOCATABLE :: id_lstate_in_pstate(:) !< Indices of local state vector in PE-local global state vector + REAL, ALLOCATABLE :: l2g_weights(:) !< Increment weights applied in l2g_state + LOGICAL :: PDAFlocal_was_used = .FALSE. !< Flag whether PDAFlocal was used (set in PDAFlocal_g2l_cb) + +!$OMP THREADPRIVATE(id_lstate_in_pstate, l2g_weights) + +!------------------------------------------------------------------------------- + + INTERFACE + SUBROUTINE PDAFlocal_g2l_cb(step, domain_p, dim_p, state_p, dim_l, state_l) + INTEGER, INTENT(in) :: step !< Current time step + INTEGER, INTENT(in) :: domain_p !< Current local analysis domain + INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension + INTEGER, INTENT(in) :: dim_l !< Local state dimension + REAL, INTENT(in) :: state_p(dim_p) !< PE-local full state vector + REAL, INTENT(out) :: state_l(dim_l) !< State vector on local analysis domain + END SUBROUTINE PDAFlocal_g2l_cb + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocal_l2g_cb(step, domain_p, dim_l, state_l, dim_p, state_p) + INTEGER, INTENT(in) :: step !< Current time step + INTEGER, INTENT(in) :: domain_p !< Current local analysis domain + INTEGER, INTENT(in) :: dim_l !< Local state dimension + INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension + REAL, INTENT(in) :: state_l(dim_l) !< State vector on local analysis domain + REAL, INTENT(inout) :: state_p(dim_p) !< PE-local full state vector + END SUBROUTINE PDAFlocal_l2g_cb + END INTERFACE + +END MODULE PDAFlocal diff --git a/src/PDAFlocal_assimilate_en3dvar_lestkf.F90 b/src/PDAFlocal_assimilate_en3dvar_lestkf.F90 new file mode 100644 index 000000000..55797a605 --- /dev/null +++ b/src/PDAFlocal_assimilate_en3dvar_lestkf.F90 @@ -0,0 +1,155 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocal_assimilate_en3dvar_lestkf --- Interface to PDAF for En3DVAR/LESTKF +! +! !INTERFACE: +SUBROUTINE PDAFlocal_assimilate_en3dvar_lestkf(U_collect_state, U_distribute_state, & + U_init_dim_obs, U_obs_op, U_init_obs, U_prodRinvA, & + U_cvt_ens, U_cvt_adj_ens, U_obs_op_lin, U_obs_op_adj, & + U_init_dim_obs_f, U_obs_op_f, U_init_obs_f, U_init_obs_l, U_prodRinvA_l, & + U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, & + U_g2l_obs, U_init_obsvar, U_init_obsvar_l, & + U_prepoststep, U_next_observation, outflag) + +! !DESCRIPTION: +! Interface routine called from the model at each time +! step during the forecast of each ensemble state. If +! the time of the next analysis step is reached the +! forecast state is transferred to PDAF and the analysis +! is computed by calling PDAFlocal_put_state_3dvar. Subsequently, +! PDAF_get_state is called to initialize the next forecast +! phase. +! +! The code is very generic. Basically the only +! filter-specific part are the calls to the +! routines PDAF\_put\_state\_X where the analysis +! is computed and PDAF\_get\_state to initialize the next +! forecast phase. The filter-specific call-back subroutines +! are specified in the calls to the two core routines. +! +! Variant for 3DVAR with domain decomposition. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2013-08 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, & + ONLY: cnt_steps, nsteps, assim_flag, use_PDAF_assim + USE PDAF_mod_filtermpi, & + ONLY: mype_world + + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(out) :: outflag ! Status flag + +! ! External subroutines +! ! (PDAF-internal names, real names are defined in the call to PDAF) + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_init_dim_obs, & ! Initialize dimension of observation vector + U_obs_op, & ! Observation operator + U_init_obsvar, & ! Initialize mean observation error variance + U_init_obs, & ! Initialize observation vector + U_prepoststep, & ! User supplied pre/poststep routine + U_prodRinvA, & ! Provide product R^-1 A + U_next_observation, & ! Routine to provide time step, time and dimension + ! of next observation + U_distribute_state, & ! Routine to distribute a state vector + U_cvt_ens, & ! Apply control vector transform matrix (ensemble) + U_cvt_adj_ens, & ! Apply adjoint control vector transform matrix (ensemble var) + U_obs_op_lin, & ! Linearized observation operator + U_obs_op_adj ! Adjoint observation operator + EXTERNAL :: U_obs_op_f, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs_f, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_init_obs_f, & ! Initialize PE-local observation vector + U_init_obs_l, & ! Init. observation vector on local analysis domain + U_init_obsvar_l, & ! Initialize local mean observation error variance + U_g2l_obs, & ! Restrict full obs. vector to local analysis domain + U_prodRinvA_l ! Provide product R^-1 A on local analysis domain + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFlocal_put_state_3dvar +! Calls: PDAF_get_state +!EOP + +! Local variables + INTEGER :: steps ! Number of time steps in next forecast phase + INTEGER :: doexit ! Exit flag; not used in this variant + REAL :: time ! Current model time; not used in this variant + + +! ***************************** +! *** At each time step *** +! ***************************** + + ! Set flag for using PDAF_assimilate + use_PDAF_assim = .TRUE. + + ! Increment time step counter + cnt_steps = cnt_steps + 1 + + +! ******************************** +! *** At end of forecast phase *** +! ******************************** + + IF (cnt_steps == nsteps) THEN + + IF (mype_world==0) WRITE(*,'(a, 5x, a)') 'PDAF', 'Perform assimilation with PDAF' + + ! Set flag for assimilation + assim_flag = 1 + + ! *** Call analysis step *** + + CALL PDAFlocal_put_state_en3dvar_lestkf(U_collect_state, & + U_init_dim_obs, U_obs_op, U_init_obs, U_prodRinvA, & + U_cvt_ens, U_cvt_adj_ens, U_obs_op_lin, U_obs_op_adj, & + U_init_dim_obs_f, U_obs_op_f, U_init_obs_f, U_init_obs_l, U_prodRinvA_l, & + U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, & + U_g2l_obs, U_init_obsvar, U_init_obsvar_l, & + U_prepoststep, outflag) + + ! *** Prepare start of next ensemble forecast *** + + IF (outflag==0) THEN + CALL PDAF_get_state(steps, time, doexit, U_next_observation, U_distribute_state, & + U_prepoststep, outflag) + END IF + + nsteps = steps + + ELSE + assim_flag = 0 + outflag = 0 + END IF + +END SUBROUTINE PDAFlocal_assimilate_en3dvar_lestkf diff --git a/src/PDAFlocal_assimilate_hyb3dvar_lestkf.F90 b/src/PDAFlocal_assimilate_hyb3dvar_lestkf.F90 new file mode 100644 index 000000000..534fcc480 --- /dev/null +++ b/src/PDAFlocal_assimilate_hyb3dvar_lestkf.F90 @@ -0,0 +1,157 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocal_assimilate_hyb3dvar_lestkf --- Interface to PDAF for Hyb3DVAR/LESTKF +! +! !INTERFACE: +SUBROUTINE PDAFlocal_assimilate_hyb3dvar_lestkf(U_collect_state, U_distribute_state, & + U_init_dim_obs, U_obs_op, U_init_obs, U_prodRinvA, & + U_cvt_ens, U_cvt_adj_ens, U_cvt, U_cvt_adj, U_obs_op_lin, U_obs_op_adj, & + U_init_dim_obs_f, U_obs_op_f, U_init_obs_f, U_init_obs_l, U_prodRinvA_l, & + U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, & + U_g2l_obs, U_init_obsvar, U_init_obsvar_l, & + U_prepoststep, U_next_observation, outflag) + +! !DESCRIPTION: +! Interface routine called from the model at each time +! step during the forecast of each ensemble state. If +! the time of the next analysis step is reached the +! forecast state is transferred to PDAF and the analysis +! is computed by calling PDAFlocal_put_state_3dvar. Subsequently, +! PDAF_get_state is called to initialize the next forecast +! phase. +! +! The code is very generic. Basically the only +! filter-specific part are the calls to the +! routines PDAF\_put\_state\_X where the analysis +! is computed and PDAF\_get\_state to initialize the next +! forecast phase. The filter-specific call-back subroutines +! are specified in the calls to the two core routines. +! +! Variant for 3DVAR with domain decomposition. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2013-08 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, & + ONLY: cnt_steps, nsteps, assim_flag, use_PDAF_assim + USE PDAF_mod_filtermpi, & + ONLY: mype_world + + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(out) :: outflag ! Status flag + +! ! External subroutines +! ! (PDAF-internal names, real names are defined in the call to PDAF) + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_init_dim_obs, & ! Initialize dimension of observation vector + U_obs_op, & ! Observation operator + U_init_obsvar, & ! Initialize mean observation error variance + U_init_obs, & ! Initialize observation vector + U_prepoststep, & ! User supplied pre/poststep routine + U_prodRinvA, & ! Provide product R^-1 A + U_next_observation, & ! Routine to provide time step, time and dimension + ! of next observation + U_distribute_state, & ! Routine to distribute a state vector + U_cvt_ens, & ! Apply control vector transform matrix (ensemble) + U_cvt_adj_ens, & ! Apply adjoint control vector transform matrix (ensemble var) + U_cvt, & ! Apply control vector transform matrix to control vector + U_cvt_adj, & ! Apply adjoint control vector transform matrix + U_obs_op_lin, & ! Linearized observation operator + U_obs_op_adj ! Adjoint observation operator + EXTERNAL :: U_obs_op_f, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs_f, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_init_obs_f, & ! Initialize PE-local observation vector + U_init_obs_l, & ! Init. observation vector on local analysis domain + U_init_obsvar_l, & ! Initialize local mean observation error variance + U_g2l_obs, & ! Restrict full obs. vector to local analysis domain + U_prodRinvA_l ! Provide product R^-1 A on local analysis domain + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFlocal_put_state_3dvar +! Calls: PDAF_get_state +!EOP + +! Local variables + INTEGER :: steps ! Number of time steps in next forecast phase + INTEGER :: doexit ! Exit flag; not used in this variant + REAL :: time ! Current model time; not used in this variant + + +! ***************************** +! *** At each time step *** +! ***************************** + + ! Set flag for using PDAF_assimilate + use_PDAF_assim = .TRUE. + + ! Increment time step counter + cnt_steps = cnt_steps + 1 + + +! ******************************** +! *** At end of forecast phase *** +! ******************************** + + IF (cnt_steps == nsteps) THEN + + IF (mype_world==0) WRITE(*,'(a, 5x, a)') 'PDAF', 'Perform assimilation with PDAF' + + ! Set flag for assimilation + assim_flag = 1 + + ! *** Call analysis step *** + + CALL PDAFlocal_put_state_hyb3dvar_lestkf(U_collect_state, & + U_init_dim_obs, U_obs_op, U_init_obs, U_prodRinvA, & + U_cvt_ens, U_cvt_adj_ens, U_cvt, U_cvt_adj, U_obs_op_lin, U_obs_op_adj, & + U_init_dim_obs_f, U_obs_op_f, U_init_obs_f, U_init_obs_l, U_prodRinvA_l, & + U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, & + U_g2l_obs, U_init_obsvar, U_init_obsvar_l, & + U_prepoststep, outflag) + + ! *** Prepare start of next ensemble forecast *** + + IF (outflag==0) THEN + CALL PDAF_get_state(steps, time, doexit, U_next_observation, U_distribute_state, & + U_prepoststep, outflag) + END IF + + nsteps = steps + + ELSE + assim_flag = 0 + outflag = 0 + END IF + +END SUBROUTINE PDAFlocal_assimilate_hyb3dvar_lestkf diff --git a/src/PDAFlocal_assimilate_lestkf.F90 b/src/PDAFlocal_assimilate_lestkf.F90 new file mode 100644 index 000000000..4dd6c5442 --- /dev/null +++ b/src/PDAFlocal_assimilate_lestkf.F90 @@ -0,0 +1,142 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocal_assimilate_lestkf --- Interface to PDAF for LESTKF +! +! !INTERFACE: +SUBROUTINE PDAFlocal_assimilate_lestkf(U_collect_state, U_distribute_state, & + U_init_dim_obs, U_obs_op, U_init_obs, U_init_obs_l, U_prepoststep, & + U_prodRinvA_l, U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, & + U_g2l_obs, U_init_obsvar, U_init_obsvar_l, & + U_next_observation, outflag) + +! !DESCRIPTION: +! Interface routine called from the model at each time +! step during the forecast of each ensemble state. If +! the time of the next analysis step is reached the +! forecast state is transferred to PDAF and the analysis +! is computed by calling PDAFlocal_put_state_lestkf. Subsequently, +! PDAF_get_state is called to initialize the next forecast +! phase. +! +! The code is very generic. Basically the only +! filter-specific part are the calls to the +! routines PDAF\_put\_state\_X where the analysis +! is computed and PDAF\_get\_state to initialize the next +! forecast phase. The filter-specific call-back subroutines +! are specified in the calls to the two core routines. +! +! Variant for LESTKF with domain decomposition. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2013-08 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, & + ONLY: cnt_steps, nsteps, assim_flag, use_PDAF_assim + USE PDAF_mod_filtermpi, & + ONLY: mype_world + + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(out) :: outflag ! Status flag + +! ! External subroutines +! ! (PDAF-internal names, real names are defined in the call to PDAF) + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_init_obs, & ! Initialize PE-local observation vector + U_init_obs_l, & ! Init. observation vector on local analysis domain + U_init_obsvar, & ! Initialize mean observation error variance + U_init_obsvar_l, & ! Initialize local mean observation error variance + U_g2l_obs, & ! Restrict full obs. vector to local analysis domain + U_prodRinvA_l, & ! Provide product R^-1 A on local analysis domain + U_prepoststep, & ! User supplied pre/poststep routine + U_next_observation, & ! Routine to provide time step, time and dimension + ! of next observation + U_distribute_state ! Routine to distribute a state vector + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFlocal_put_state_lestkf +! Calls: PDAF_get_state_lestkf +!EOP + +! Local variables + INTEGER :: steps ! Number of time steps in next forecast phase + INTEGER :: doexit ! Exit flag; not used in this variant + REAL :: time ! Current model time; not used in this variant + + +! ***************************** +! *** At each time step *** +! ***************************** + + ! Set flag for using PDAF_assimilate + use_PDAF_assim = .TRUE. + + ! Increment time step counter + cnt_steps = cnt_steps + 1 + + +! ******************************** +! *** At end of forecast phase *** +! ******************************** + + IF (cnt_steps == nsteps) THEN + + IF (mype_world==0) WRITE(*,'(a, 5x, a)') 'PDAF', 'Perform assimilation with PDAF' + + ! Set flag for assimilation + assim_flag = 1 + + ! *** Call analysis step *** + + CALL PDAFlocal_put_state_lestkf(U_collect_state, U_init_dim_obs, U_obs_op, & + U_init_obs, U_init_obs_l, U_prepoststep, U_prodRinvA_l, U_init_n_domains_p, & + U_init_dim_l, U_init_dim_obs_l, U_g2l_obs, & + U_init_obsvar, U_init_obsvar_l, outflag) + + ! *** Prepare start of next ensemble forecast *** + + IF (outflag==0) THEN + CALL PDAF_get_state(steps, time, doexit, U_next_observation, U_distribute_state, & + U_prepoststep, outflag) + END IF + + nsteps = steps + + ELSE + assim_flag = 0 + outflag = 0 + END IF + +END SUBROUTINE PDAFlocal_assimilate_lestkf diff --git a/src/PDAFlocal_assimilate_lestkf_si.F90 b/src/PDAFlocal_assimilate_lestkf_si.F90 new file mode 100644 index 000000000..ddf37b626 --- /dev/null +++ b/src/PDAFlocal_assimilate_lestkf_si.F90 @@ -0,0 +1,88 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocal_assimilate_lestkf_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocal_assimilate_lestkf_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! Variant for SEIK with domain decomposition. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2013-08 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + obs_op_f_pdaf, & ! Full observation operator + init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector + init_dim_obs_l_pdaf, & ! Initialize local dimimension of obs. vector + init_obs_f_pdaf, & ! Initialize full observation vector + init_obs_l_pdaf, & ! Initialize local observation vector + init_obsvar_pdaf, & ! Initialize mean observation error variance + init_obsvar_l_pdaf, & ! Initialize local mean observation error variance + g2l_obs_pdaf, & ! Restrict full obs. vector to local analysis domain + prodRinvA_l_pdaf, & ! Provide product R^-1 A on local analysis domain + prepoststep_pdaf, & ! User supplied pre/poststep routine + next_observation_pdaf ! Routine to provide time step, time and dimension + ! of next observation + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFlocal_assimilate_lestkf +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFlocal_assimilate_lestkf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, init_obs_f_pdaf, init_obs_l_pdaf, & + prepoststep_pdaf, prodRinvA_l_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdaf, & + g2l_obs_pdaf, init_obsvar_pdaf, init_obsvar_l_pdaf, next_observation_pdaf, & + outflag) + +END SUBROUTINE PDAFlocal_assimilate_lestkf_si diff --git a/src/PDAFlocal_assimilate_letkf.F90 b/src/PDAFlocal_assimilate_letkf.F90 new file mode 100644 index 000000000..b9aed02fc --- /dev/null +++ b/src/PDAFlocal_assimilate_letkf.F90 @@ -0,0 +1,142 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocal_assimilate_letkf --- Interface to PDAF for LETKF +! +! !INTERFACE: +SUBROUTINE PDAFlocal_assimilate_letkf(U_collect_state, U_distribute_state, & + U_init_dim_obs, U_obs_op, U_init_obs, U_init_obs_l, U_prepoststep, & + U_prodRinvA_l, U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, & + U_g2l_obs, U_init_obsvar, U_init_obsvar_l, & + U_next_observation, outflag) + +! !DESCRIPTION: +! Interface routine called from the model at each time +! step during the forecast of each ensemble state. If +! the time of the next analysis step is reached the +! forecast state is transferred to PDAF and the analysis +! is computed by calling PDAFlocal_put_state_letkf. Subsequently, +! PDAF_get_state is called to initialize the next forecast +! phase. +! +! The code is very generic. Basically the only +! filter-specific part are the calls to the +! routines PDAF\_put\_state\_X where the analysis +! is computed and PDAF\_get\_state to initialize the next +! forecast phase. The filter-specific call-back subroutines +! are specified in the calls to the two core routines. +! +! Variant for LETKF with domain decomposition. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2013-08 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, & + ONLY: cnt_steps, nsteps, assim_flag, use_PDAF_assim + USE PDAF_mod_filtermpi, & + ONLY: mype_world + + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(out) :: outflag ! Status flag + +! ! External subroutines +! ! (PDAF-internal names, real names are defined in the call to PDAF) + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_init_obs, & ! Initialize PE-local observation vector + U_init_obs_l, & ! Init. observation vector on local analysis domain + U_init_obsvar, & ! Initialize mean observation error variance + U_init_obsvar_l, & ! Initialize local mean observation error variance + U_g2l_obs, & ! Restrict full obs. vector to local analysis domain + U_prodRinvA_l, & ! Provide product R^-1 A on local analysis domain + U_prepoststep, & ! User supplied pre/poststep routine + U_next_observation, & ! Routine to provide time step, time and dimension + ! of next observation + U_distribute_state ! Routine to distribute a state vector + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFlocal_put_state_letkf +! Calls: PDAF_get_state +!EOP + +! Local variables + INTEGER :: steps ! Number of time steps in next forecast phase + INTEGER :: doexit ! Exit flag; not used in this variant + REAL :: time ! Current model time; not used in this variant + + +! ***************************** +! *** At each time step *** +! ***************************** + + ! Set flag for using PDAF_assimilate + use_PDAF_assim = .TRUE. + + ! Increment time step counter + cnt_steps = cnt_steps + 1 + + +! ******************************** +! *** At end of forecast phase *** +! ******************************** + + IF (cnt_steps == nsteps) THEN + + IF (mype_world==0) WRITE(*,'(a, 5x, a)') 'PDAF', 'Perform assimilation with PDAF' + + ! Set flag for assimilation + assim_flag = 1 + + ! *** Call analysis step *** + + CALL PDAFlocal_put_state_letkf(U_collect_state, U_init_dim_obs, U_obs_op, & + U_init_obs, U_init_obs_l, U_prepoststep, U_prodRinvA_l, U_init_n_domains_p, & + U_init_dim_l, U_init_dim_obs_l, U_g2l_obs, & + U_init_obsvar, U_init_obsvar_l, outflag) + + ! *** Prepare start of next ensemble forecast *** + + IF (outflag==0) THEN + CALL PDAF_get_state(steps, time, doexit, U_next_observation, U_distribute_state, & + U_prepoststep, outflag) + END IF + + nsteps = steps + + ELSE + assim_flag = 0 + outflag = 0 + END IF + +END SUBROUTINE PDAFlocal_assimilate_letkf diff --git a/src/PDAFlocal_assimilate_letkf_si.F90 b/src/PDAFlocal_assimilate_letkf_si.F90 new file mode 100644 index 000000000..74a43c5d3 --- /dev/null +++ b/src/PDAFlocal_assimilate_letkf_si.F90 @@ -0,0 +1,88 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocal_assimilate_letkf_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocal_assimilate_letkf_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! Variant for SEIK with domain decomposition. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2013-08 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + obs_op_f_pdaf, & ! Full observation operator + init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector + init_dim_obs_l_pdaf, & ! Initialize local dimimension of obs. vector + init_obs_f_pdaf, & ! Initialize full observation vector + init_obs_l_pdaf, & ! Initialize local observation vector + init_obsvar_pdaf, & ! Initialize mean observation error variance + init_obsvar_l_pdaf, & ! Initialize local mean observation error variance + g2l_obs_pdaf, & ! Restrict full obs. vector to local analysis domain + prodRinvA_l_pdaf, & ! Provide product R^-1 A on local analysis domain + prepoststep_pdaf, & ! User supplied pre/poststep routine + next_observation_pdaf ! Routine to provide time step, time and dimension + ! of next observation + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFlocal_assimilate_letkf +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFlocal_assimilate_letkf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, init_obs_f_pdaf, init_obs_l_pdaf, & + prepoststep_pdaf, prodRinvA_l_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdaf, & + g2l_obs_pdaf, init_obsvar_pdaf, init_obsvar_l_pdaf, next_observation_pdaf, & + outflag) + +END SUBROUTINE PDAFlocal_assimilate_letkf_si diff --git a/src/PDAFlocal_assimilate_lknetf.F90 b/src/PDAFlocal_assimilate_lknetf.F90 new file mode 100644 index 000000000..e2be00e27 --- /dev/null +++ b/src/PDAFlocal_assimilate_lknetf.F90 @@ -0,0 +1,149 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocal_assimilate_lknetf --- Interface to PDAF for LKNETF +! +! !INTERFACE: +SUBROUTINE PDAFlocal_assimilate_lknetf(U_collect_state, U_distribute_state, & + U_init_dim_obs, U_obs_op, U_init_obs, U_init_obs_l, U_prepoststep, & + U_prodRinvA_l, U_prodRinvA_hyb_l, U_init_n_domains_p, U_init_dim_l, & + U_init_dim_obs_l, & + U_g2l_obs, U_init_obsvar, U_init_obsvar_l, & + U_likelihood_l, U_likelihood_hyb_l, & + U_next_observation, outflag) + +! !DESCRIPTION: +! Interface routine called from the model at each time +! step during the forecast of each ensemble state. If +! the time of the next analysis step is reached the +! forecast state is transferred to PDAF and the analysis +! is computed by calling PDAFlocal_put_state_lknetf. Subsequently, +! PDAF_get_state is called to initialize the next forecast +! phase. +! +! The code is very generic. Basically the only +! filter-specific part are the calls to the +! routines PDAF\_put\_state\_X where the analysis +! is computed and PDAF\_get\_state to initialize the next +! forecast phase. The filter-specific call-back subroutines +! are specified in the calls to the two core routines. +! +! Variant for LKNETF with domain decomposition. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2017-08 - Lars Nerger - Initial code based on LETKF +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, & + ONLY: cnt_steps, nsteps, assim_flag, use_PDAF_assim + USE PDAF_mod_filtermpi, & + ONLY: mype_world + + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(out) :: outflag ! Status flag + +! ! External subroutines +! ! (PDAF-internal names, real names are defined in the call to PDAF) + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_init_obs, & ! Initialize PE-local observation vector + U_init_obs_l, & ! Init. observation vector on local analysis domain + U_init_obsvar, & ! Initialize mean observation error variance + U_init_obsvar_l, & ! Initialize local mean observation error variance + U_g2l_obs, & ! Restrict full obs. vector to local analysis domain + U_prodRinvA_l, & ! Provide product R^-1 A on local analysis domain + U_prodRinvA_hyb_l, & ! Provide product R^-1 A on local analysis domain with hybrid weight + U_likelihood_l, & ! Compute likelihood + U_likelihood_hyb_l, & ! Compute likelihood with hybrid weight + U_prepoststep, & ! User supplied pre/poststep routine + U_next_observation, & ! Routine to provide time step, time and dimension + ! of next observation + U_distribute_state ! Routine to distribute a state vector + + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFlocal_put_state_lknetf +! Calls: PDAF_get_state +!EOP + +! Local variables + INTEGER :: steps ! Number of time steps in next forecast phase + INTEGER :: doexit ! Exit flag; not used in this variant + REAL :: time ! Current model time; not used in this variant + + +! ***************************** +! *** At each time step *** +! ***************************** + + ! Set flag for using PDAF_assimilate + use_PDAF_assim = .TRUE. + + ! Increment time step counter + cnt_steps = cnt_steps + 1 + + +! ********************************************** +! *** At observation time - analysis step *** +! ********************************************** + + IF (cnt_steps == nsteps) THEN + + IF (mype_world==0) WRITE(*,'(a, 5x, a)') 'PDAF', 'Perform assimilation with PDAF - LKNETF' + + ! Set flag for assimilation + assim_flag = 1 + + ! *** Call analysis step *** + + CALL PDAFlocal_put_state_lknetf(U_collect_state, U_init_dim_obs, U_obs_op, & + U_init_obs, U_init_obs_l, U_prepoststep, U_prodRinvA_l, U_prodRinvA_hyb_l, & + U_init_n_domains_p, & + U_init_dim_l, U_init_dim_obs_l, U_g2l_obs, & + U_init_obsvar, U_init_obsvar_l, U_likelihood_l, U_likelihood_hyb_l, outflag) + + ! *** Prepare start of next ensemble forecast *** + + IF (outflag==0) THEN + CALL PDAF_get_state(steps, time, doexit, U_next_observation, & + U_distribute_state, U_prepoststep, outflag) + END IF + + nsteps = steps + + ELSE + assim_flag = 0 + outflag = 0 + END IF + +END SUBROUTINE PDAFlocal_assimilate_lknetf diff --git a/src/PDAFlocal_assimilate_lknetf_si.F90 b/src/PDAFlocal_assimilate_lknetf_si.F90 new file mode 100644 index 000000000..4e79a202b --- /dev/null +++ b/src/PDAFlocal_assimilate_lknetf_si.F90 @@ -0,0 +1,92 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocal_assimilate_lknetf_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocal_assimilate_lknetf_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! Variant for SEIK with domain decomposition. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2017-08 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + obs_op_f_pdaf, & ! Full observation operator + init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector + init_dim_obs_l_pdaf, & ! Initialize local dimimension of obs. vector + init_obs_f_pdaf, & ! Initialize full observation vector + init_obs_l_pdaf, & ! Initialize local observation vector + init_obsvar_pdaf, & ! Initialize mean observation error variance + init_obsvar_l_pdaf, & ! Initialize local mean observation error variance + g2l_obs_pdaf, & ! Restrict full obs. vector to local analysis domain + prodRinvA_l_pdaf, & ! Provide product R^-1 A on local analysis domain + prodRinvA_hyb_l_pdaf, & ! Provide product R^-1 A on local analysis domain with hybrid weight + likelihood_l_pdaf, & ! Compute observation likelihood for an ensemble member + likelihood_hyb_l_pdaf, & ! Compute observation likelihood for an ensemble member with hybrid weight + prepoststep_pdaf, & ! User supplied pre/poststep routine + next_observation_pdaf ! Routine to provide time step, time and dimension + ! of next observation + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFlocal_assimilate_lknetf +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFlocal_assimilate_lknetf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, init_obs_f_pdaf, init_obs_l_pdaf, & + prepoststep_pdaf, prodRinvA_l_pdaf, prodRinvA_hyb_l_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdaf, & + g2l_obs_pdaf, init_obsvar_pdaf, init_obsvar_l_pdaf, likelihood_l_pdaf, & + likelihood_hyb_l_pdaf, next_observation_pdaf, & + outflag) + +END SUBROUTINE PDAFlocal_assimilate_lknetf_si diff --git a/src/PDAFlocal_assimilate_lnetf.F90 b/src/PDAFlocal_assimilate_lnetf.F90 new file mode 100644 index 000000000..1e29a1666 --- /dev/null +++ b/src/PDAFlocal_assimilate_lnetf.F90 @@ -0,0 +1,139 @@ +! Copyright (c) 2014-2024 Paul Kirchgessner +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocal_assimilate_lnetf --- Interface to PDAF for LNETF +! +! !INTERFACE: +SUBROUTINE PDAFlocal_assimilate_lnetf(U_collect_state, U_distribute_state, & + U_init_dim_obs, U_obs_op, U_init_obs_l, U_prepoststep, & + U_likelihood_l, U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, & + U_g2l_obs, U_next_observation, outflag) + +! !DESCRIPTION: +! Interface routine called from the model at each time +! step during the forecast of each ensemble state. If +! the time of the next analysis step is reached the +! forecast state is transferred to PDAF and the analysis +! is computed by calling PDAFlocal_put_state_lnetf. Subsequently, +! PDAF_get_state is called to initialize the next forecast +! phase. +! +! The code is very generic. Basically the only +! filter-specific part are the calls to the +! routines PDAF\_put\_state\_X where the analysis +! is computed and PDAF\_get\_state to initialize the next +! forecast phase. The filter-specific call-back subroutines +! are specified in the calls to the two core routines. +! +! Variant for LNETF with domain decomposition. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2014-05 - Paul Kirchgessner - Initial code based on ETKF +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, & + ONLY: cnt_steps, nsteps, assim_flag, use_PDAF_assim + USE PDAF_mod_filtermpi, & + ONLY: mype_world + + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(out) :: outflag ! Status flag + +! ! External subroutines +! ! (PDAF-internal names, real names are defined in the call to PDAF) + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_init_obs_l, & ! Init. observation vector on local analysis domain + U_g2l_obs, & ! Restrict full obs. vector to local analysis domain + U_likelihood_l, & ! Compute observation likelihood for an ensemble member + U_prepoststep, & ! User supplied pre/poststep routine + U_next_observation, & ! Routine to provide time step, time and dimension + ! of next observation + U_distribute_state ! Routine to distribute a state vector + + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFlocal_put_state_lnetkf +! Calls: PDAF_get_state +!EOP + +! Local variables + INTEGER :: steps ! Number of time steps in next forecast phase + INTEGER :: doexit ! Exit flag; not used in this variant + REAL :: time ! Current model time; not used in this variant + + +! ***************************** +! *** At each time step *** +! ***************************** + + ! Set flag for using PDAF_assimilate + use_PDAF_assim = .TRUE. + + ! Increment time step counter + cnt_steps = cnt_steps + 1 + + +! ********************************************** +! *** At observation time - analysis step *** +! ********************************************** + + IF (cnt_steps == nsteps) THEN + IF (mype_world==0) WRITE(*,'(a, 5x, a)') 'PDAF', 'Perform assimilation with PDAF - LNETF' + + ! Set flag for assimilation + assim_flag = 1 + + ! *** Call analysis step *** + + CALL PDAFlocal_put_state_lnetf(U_collect_state, U_init_dim_obs, U_obs_op, & + U_init_obs_l, U_prepoststep, U_likelihood_l, U_init_n_domains_p, & + U_init_dim_l, U_init_dim_obs_l, U_g2l_obs, & + outflag) + + ! *** Prepare start of next ensemble forecast *** + + IF (outflag==0) THEN + CALL PDAF_get_state(steps, time, doexit, U_next_observation, & + U_distribute_state, U_prepoststep, outflag) + END IF + + nsteps = steps + + ELSE + assim_flag = 0 + outflag = 0 + END IF + + +END SUBROUTINE PDAFlocal_assimilate_lnetf diff --git a/src/PDAFlocal_assimilate_lnetf_si.F90 b/src/PDAFlocal_assimilate_lnetf_si.F90 new file mode 100644 index 000000000..af7c8db98 --- /dev/null +++ b/src/PDAFlocal_assimilate_lnetf_si.F90 @@ -0,0 +1,83 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocal_assimilate_lnetf_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocal_assimilate_lnetf_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! Variant for LNETF with domain decomposition. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2016-11 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + obs_op_f_pdaf, & ! Full observation operator + init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector + init_dim_obs_l_pdaf, & ! Initialize local dimimension of obs. vector + init_obs_l_pdaf, & ! Initialize local observation vector + g2l_obs_pdaf, & ! Restrict full obs. vector to local analysis domain + likelihood_l_pdaf, & ! Compute observation likelihood for an ensemble member + prepoststep_pdaf, & ! User supplied pre/poststep routine + next_observation_pdaf ! Routine to provide time step, time and dimension + ! of next observation + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFlocal_assimilate_lestkf +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFlocal_assimilate_lnetf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, init_obs_l_pdaf, prepoststep_pdaf, & + likelihood_l_pdaf, init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdaf, & + g2l_obs_pdaf, next_observation_pdaf, outflag) + +END SUBROUTINE PDAFlocal_assimilate_lnetf_si diff --git a/src/PDAFlocal_assimilate_lseik.F90 b/src/PDAFlocal_assimilate_lseik.F90 new file mode 100644 index 000000000..563e153bf --- /dev/null +++ b/src/PDAFlocal_assimilate_lseik.F90 @@ -0,0 +1,142 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocal_assimilate_lseik --- Interface to PDAF for LSEIK +! +! !INTERFACE: +SUBROUTINE PDAFlocal_assimilate_lseik(U_collect_state, U_distribute_state, & + U_init_dim_obs, U_obs_op, U_init_obs, U_init_obs_l, U_prepoststep, & + U_prodRinvA_l, U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, & + U_g2l_obs, U_init_obsvar, U_init_obsvar_l, & + U_next_observation, outflag) + +! !DESCRIPTION: +! Interface routine called from the model at each time +! step during the forecast of each ensemble state. If +! the time of the next analysis step is reached the +! forecast state is transferred to PDAF and the analysis +! is computed by calling PDAFlocal_put_state_lseik. Subsequently, +! PDAF_get_state is called to initialize the next forecast +! phase. +! +! The code is very generic. Basically the only +! filter-specific part are the calls to the +! routines PDAF\_put\_state\_X where the analysis +! is computed and PDAF\_get\_state to initialize the next +! forecast phase. The filter-specific call-back subroutines +! are specified in the calls to the two core routines. +! +! Variant for LSEIK with domain decomposition. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2013-08 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, & + ONLY: cnt_steps, nsteps, assim_flag, use_PDAF_assim + USE PDAF_mod_filtermpi, & + ONLY: mype_world + + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(out) :: outflag ! Status flag + +! ! External subroutines +! ! (PDAF-internal names, real names are defined in the call to PDAF) + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_init_obs, & ! Initialize PE-local observation vector + U_init_obs_l, & ! Init. observation vector on local analysis domain + U_init_obsvar, & ! Initialize mean observation error variance + U_init_obsvar_l, & ! Initialize local mean observation error variance + U_g2l_obs, & ! Restrict full obs. vector to local analysis domain + U_prodRinvA_l, & ! Provide product R^-1 A on local analysis domain + U_prepoststep, & ! User supplied pre/poststep routine + U_next_observation, & ! Routine to provide time step, time and dimension + ! of next observation + U_distribute_state ! Routine to distribute a state vector + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFlocal_put_state_lseik +! Calls: PDAF_get_state_lseik +!EOP + +! Local variables + INTEGER :: steps ! Number of time steps in next forecast phase + INTEGER :: doexit ! Exit flag; not used in this variant + REAL :: time ! Current model time; not used in this variant + + +! ***************************** +! *** At each time step *** +! ***************************** + + ! Set flag for using PDAF_assimilate + use_PDAF_assim = .TRUE. + + ! Increment time step counter + cnt_steps = cnt_steps + 1 + + +! ******************************** +! *** At end of forecast phase *** +! ******************************** + + IF (cnt_steps == nsteps) THEN + + IF (mype_world==0) WRITE(*,'(a, 5x, a)') 'PDAF', 'Perform assimilation with PDAF' + + ! Set flag for assimilation + assim_flag = 1 + + ! *** Call analysis step *** + + CALL PDAFlocal_put_state_lseik(U_collect_state, U_init_dim_obs, U_obs_op, & + U_init_obs, U_init_obs_l, U_prepoststep, U_prodRinvA_l, U_init_n_domains_p, & + U_init_dim_l, U_init_dim_obs_l, U_g2l_obs, & + U_init_obsvar, U_init_obsvar_l, outflag) + + ! *** Prepare start of next ensemble forecast *** + + IF (outflag==0) THEN + CALL PDAF_get_state(steps, time, doexit, U_next_observation, U_distribute_state, & + U_prepoststep, outflag) + END IF + + nsteps = steps + + ELSE + assim_flag = 0 + outflag = 0 + END IF + +END SUBROUTINE PDAFlocal_assimilate_lseik diff --git a/src/PDAFlocal_assimilate_lseik_si.F90 b/src/PDAFlocal_assimilate_lseik_si.F90 new file mode 100644 index 000000000..459e964bc --- /dev/null +++ b/src/PDAFlocal_assimilate_lseik_si.F90 @@ -0,0 +1,88 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocal_assimilate_lseik_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocal_assimilate_lseik_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! Variant for SEIK with domain decomposition. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2013-08 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + obs_op_f_pdaf, & ! Full observation operator + init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector + init_dim_obs_l_pdaf, & ! Initialize local dimimension of obs. vector + init_obs_f_pdaf, & ! Initialize full observation vector + init_obs_l_pdaf, & ! Initialize local observation vector + init_obsvar_pdaf, & ! Initialize mean observation error variance + init_obsvar_l_pdaf, & ! Initialize local mean observation error variance + g2l_obs_pdaf, & ! Restrict full obs. vector to local analysis domain + prodRinvA_l_pdaf, & ! Provide product R^-1 A on local analysis domain + prepoststep_pdaf, & ! User supplied pre/poststep routine + next_observation_pdaf ! Routine to provide time step, time and dimension + ! of next observation + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFlocal_assimilate_lseik +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFlocal_assimilate_lseik(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, init_obs_f_pdaf, init_obs_l_pdaf, & + prepoststep_pdaf, prodRinvA_l_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdaf, & + g2l_obs_pdaf, init_obsvar_pdaf, init_obsvar_l_pdaf, next_observation_pdaf, & + outflag) + +END SUBROUTINE PDAFlocal_assimilate_lseik_si diff --git a/src/PDAFlocal_clear_increment_weights.F90 b/src/PDAFlocal_clear_increment_weights.F90 new file mode 100644 index 000000000..ba86d805f --- /dev/null +++ b/src/PDAFlocal_clear_increment_weights.F90 @@ -0,0 +1,48 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! + +!> Deallocate vector of local increment weights +!! +!! This routine simply deallocates the local increment +!! weight vector if it is allocated. +!! +!! __Revision history:__ +!! * 2024-08 - Lars Nerger - Initial code +!! * Later revisions - see repository log +!! +SUBROUTINE PDAFlocal_clear_increment_weights() + + USE PDAF_mod_filter, & + ONLY: debug + USE PDAFlocal, & + ONLY: l2g_weights + + IMPLICIT NONE + + +! ***************************************** +! *** Deallocate increment weight array *** +! ***************************************** + + IF (ALLOCATED(l2g_weights)) DEALLOCATE(l2g_weights) + + IF (debug>0) THEN + WRITE (*,*) '++ PDAF-debug: ', debug, 'PDAFlocal_free_increment_weights -- Unset local increment weights' + END IF + +END SUBROUTINE PDAFlocal_clear_increment_weights diff --git a/src/PDAFlocal_g2l_cb.F90 b/src/PDAFlocal_g2l_cb.F90 new file mode 100644 index 000000000..e4ce65464 --- /dev/null +++ b/src/PDAFlocal_g2l_cb.F90 @@ -0,0 +1,69 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocal_g2l_cb - Project global to local vector according to index array +! +! !INTERFACE: +SUBROUTINE PDAFlocal_g2l_cb(step, domain_p, dim_p, state_p, dim_l, state_l) + +! !DESCRIPTION: +! Project a global to a local state vector for the localized filters. +! This is the full callback function to be used internally. The mapping +! is done using the index vector id_lstate_in_pstate that is initialize +! in PDAF_local_set_index. +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + USE PDAFlocal, & + ONLY: id_lstate_in_pstate, PDAFlocal_was_used + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(in) :: step !< Current time step + INTEGER, INTENT(in) :: domain_p !< Current local analysis domain + INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension + INTEGER, INTENT(in) :: dim_l !< Local state dimension + REAL, INTENT(in) :: state_p(dim_p) !< PE-local full state vector + REAL, INTENT(out) :: state_l(dim_l) !< State vector on local analysis domain + +! !CALLING SEQUENCE: +! Called by filter routine +!EOP + +! *** local variables *** + INTEGER :: i ! Counter + + +! ************************************* +! *** Initialize local state vector *** +! ************************************* + + ! Set flag that PDAFlocal was used + PDAFlocal_was_used = .TRUE. + + DO i = 1, dim_l + state_l(i) = state_p(id_lstate_in_pstate(i)) + END DO + +END SUBROUTINE PDAFlocal_g2l_cb diff --git a/src/PDAFlocal_interfaces.F90 b/src/PDAFlocal_interfaces.F90 new file mode 100644 index 000000000..6d045d8e9 --- /dev/null +++ b/src/PDAFlocal_interfaces.F90 @@ -0,0 +1,881 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocal_interfaces --- Interface definitions for PDAFlocal +! +! !INTERFACE: +MODULE PDAFlocal_interfaces + +! !DESCRIPTION: +! Module providing interface definition of the PDAFlocal routines that +! are called from the model code. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +!EOP +! +! !USES: +! Include definitions for real type of different precision +! (Defines BLAS/LAPACK routines and MPI_REALTYPE) +#include "typedefs.h" + + INTERFACE + SUBROUTINE PDAFlocal_put_state_lseik(U_collect_state, U_init_dim_obs, U_obs_op, & + U_init_obs, U_init_obs_l, U_prepoststep, U_prodRinvA_l, U_init_n_domains_p, & + U_init_dim_l, U_init_dim_obs_l, U_g2l_obs, & + U_init_obsvar, U_init_obsvar_l, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_init_obs, & ! Initialize PE-local observation vector + U_init_obs_l, & ! Init. observation vector on local analysis domain + U_init_obsvar, & ! Initialize mean observation error variance + U_init_obsvar_l, & ! Initialize local mean observation error variance + U_g2l_obs, & ! Restrict full obs. vector to local analysis domain + U_prodRinvA_l, & ! Provide product R^-1 A on local analysis domain + U_prepoststep ! User supplied pre/poststep routine + END SUBROUTINE PDAFlocal_put_state_lseik + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocal_put_state_lseik_si(flag) + INTEGER, INTENT(inout) :: flag ! Status flag + END SUBROUTINE PDAFlocal_put_state_lseik_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocal_assimilate_lseik(U_collect_state, U_distribute_state, & + U_init_dim_obs, U_obs_op, U_init_obs, U_init_obs_l, U_prepoststep, & + U_prodRinvA_l, U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, & + U_g2l_obs, U_init_obsvar, U_init_obsvar_l, & + U_next_observation, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_distribute_state, & ! Routine to distribute a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_init_obs, & ! Initialize PE-local observation vector + U_init_obs_l, & ! Init. observation vector on local analysis domain + U_init_obsvar, & ! Initialize mean observation error variance + U_init_obsvar_l, & ! Initialize local mean observation error variance + U_g2l_obs, & ! Restrict full obs. vector to local analysis domain + U_prodRinvA_l, & ! Provide product R^-1 A on local analysis domain + U_prepoststep, & ! User supplied pre/poststep routine + U_next_observation ! Provide time step and time of next observation + END SUBROUTINE PDAFlocal_assimilate_lseik + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocal_assimilate_lseik_si(flag) + INTEGER, INTENT(inout) :: flag ! Status flag + END SUBROUTINE PDAFlocal_assimilate_lseik_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocal_put_state_letkf(U_collect_state, U_init_dim_obs, U_obs_op, & + U_init_obs, U_init_obs_l, U_prepoststep, U_prodRinvA_l, U_init_n_domains_p, & + U_init_dim_l, U_init_dim_obs_l, U_g2l_obs, & + U_init_obsvar, U_init_obsvar_l, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_init_obs, & ! Initialize PE-local observation vector + U_init_obs_l, & ! Init. observation vector on local analysis domain + U_init_obsvar, & ! Initialize mean observation error variance + U_init_obsvar_l, & ! Initialize local mean observation error variance + U_g2l_obs, & ! Restrict full obs. vector to local analysis domain + U_prodRinvA_l, & ! Provide product R^-1 A on local analysis domain + U_prepoststep ! User supplied pre/poststep routine + END SUBROUTINE PDAFlocal_put_state_letkf + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocal_put_state_letkf_si(flag) + INTEGER, INTENT(inout) :: flag ! Status flag + END SUBROUTINE PDAFlocal_put_state_letkf_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocal_assimilate_letkf(U_collect_state, U_distribute_state, & + U_init_dim_obs, U_obs_op, U_init_obs, U_init_obs_l, U_prepoststep, & + U_prodRinvA_l, U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, & + U_g2l_obs, U_init_obsvar, U_init_obsvar_l, & + U_next_observation, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_distribute_state, & ! Routine to distribute a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_init_obs, & ! Initialize PE-local observation vector + U_init_obs_l, & ! Init. observation vector on local analysis domain + U_init_obsvar, & ! Initialize mean observation error variance + U_init_obsvar_l, & ! Initialize local mean observation error variance + U_g2l_obs, & ! Restrict full obs. vector to local analysis domain + U_prodRinvA_l, & ! Provide product R^-1 A on local analysis domain + U_prepoststep, & ! User supplied pre/poststep routine + U_next_observation ! Provide time step and time of next observation + END SUBROUTINE PDAFlocal_assimilate_letkf + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocal_assimilate_letkf_si(flag) + INTEGER, INTENT(inout) :: flag ! Status flag + END SUBROUTINE PDAFlocal_assimilate_letkf_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocal_put_state_lestkf(U_collect_state, U_init_dim_obs, U_obs_op, & + U_init_obs, U_init_obs_l, U_prepoststep, U_prodRinvA_l, U_init_n_domains_p, & + U_init_dim_l, U_init_dim_obs_l, U_g2l_obs, & + U_init_obsvar, U_init_obsvar_l, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_init_obs, & ! Initialize PE-local observation vector + U_init_obs_l, & ! Init. observation vector on local analysis domain + U_init_obsvar, & ! Initialize mean observation error variance + U_init_obsvar_l, & ! Initialize local mean observation error variance + U_g2l_obs, & ! Restrict full obs. vector to local analysis domain + U_prodRinvA_l, & ! Provide product R^-1 A on local analysis domain + U_prepoststep ! User supplied pre/poststep routine + END SUBROUTINE PDAFlocal_put_state_lestkf + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocal_put_state_lestkf_si(flag) + INTEGER, INTENT(inout) :: flag ! Status flag + END SUBROUTINE PDAFlocal_put_state_lestkf_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocal_assimilate_lestkf(U_collect_state, U_distribute_state, & + U_init_dim_obs, U_obs_op, U_init_obs, U_init_obs_l, U_prepoststep, & + U_prodRinvA_l, U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, & + U_g2l_obs, U_init_obsvar, U_init_obsvar_l, U_next_observation, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_distribute_state, & ! Routine to distribute a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_init_obs, & ! Initialize PE-local observation vector + U_init_obs_l, & ! Init. observation vector on local analysis domain + U_init_obsvar, & ! Initialize mean observation error variance + U_init_obsvar_l, & ! Initialize local mean observation error variance + U_g2l_obs, & ! Restrict full obs. vector to local analysis domain + U_prodRinvA_l, & ! Provide product R^-1 A on local analysis domain + U_prepoststep, & ! User supplied pre/poststep routine + U_next_observation ! Provide time step and time of next observation + END SUBROUTINE PDAFlocal_assimilate_lestkf + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocal_assimilate_lestkf_si(flag) + INTEGER, INTENT(inout) :: flag ! Status flag + END SUBROUTINE PDAFlocal_assimilate_lestkf_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocal_put_state_lnetf(U_collect_state, U_init_dim_obs, U_obs_op, & + U_init_obs_l, U_prepoststep, U_likelihood_l, U_init_n_domains_p, & + U_init_dim_l, U_init_dim_obs_l, U_g2l_obs, & + outflag) + INTEGER, INTENT(out) :: outflag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_init_obs, & ! Initialize PE-local observation vector + U_init_obs_l, & ! Init. observation vector on local analysis domain + U_g2l_obs, & ! Restrict full obs. vector to local analysis domain + U_likelihood_l, & ! Compute observation likelihood for an ensemble member + U_prepoststep ! User supplied pre/poststep routine + END SUBROUTINE PDAFlocal_put_state_lnetf + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocal_put_state_lnetf_si(flag) + INTEGER, INTENT(inout) :: flag ! Status flag + END SUBROUTINE PDAFlocal_put_state_lnetf_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocal_assimilate_lnetf(U_collect_state, U_distribute_state, & + U_init_dim_obs, U_obs_op, U_init_obs_l, U_prepoststep, & + U_likelihood_l, U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, & + U_g2l_obs, U_next_observation, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_distribute_state, & ! Routine to distribute a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_init_obs_l, & ! Init. observation vector on local analysis domain + U_g2l_obs, & ! Restrict full obs. vector to local analysis domain + U_likelihood_l, & ! Compute observation likelihood for an ensemble member + U_prepoststep, & ! User supplied pre/poststep routine + U_next_observation ! Provide time step and time of next observation + END SUBROUTINE PDAFlocal_assimilate_lnetf + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocal_assimilate_lnetf_si(flag) + INTEGER, INTENT(inout) :: flag ! Status flag + END SUBROUTINE PDAFlocal_assimilate_lnetf_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocal_put_state_lknetf(U_collect_state, U_init_dim_obs, U_obs_op, & + U_init_obs, U_init_obs_l, U_prepoststep, U_prodRinvA_l, U_prodRinvA_hyb_l, & + U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, U_g2l_obs, & + U_init_obsvar, U_init_obsvar_l, U_likelihood_l, U_likelihood_hyb_l, outflag) + INTEGER, INTENT(out) :: outflag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_init_obs, & ! Initialize PE-local observation vector + U_init_obs_l, & ! Init. observation vector on local analysis domain + U_init_obsvar, & ! Initialize mean observation error variance + U_init_obsvar_l, & ! Initialize local mean observation error variance + U_g2l_obs, & ! Restrict full obs. vector to local analysis domain + U_prodRinvA_l, & ! Provide product R^-1 A on local analysis domain + U_prodRinvA_hyb_l, & ! Provide product R^-1 A on local analysis domain with hybrid weight + U_likelihood_l, & ! Compute likelihood + U_likelihood_hyb_l, & ! Compute likelihood with hybrid weight + U_prepoststep ! User supplied pre/poststep routine + END SUBROUTINE PDAFlocal_put_state_lknetf + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocal_put_state_lknetf_si(flag) + INTEGER, INTENT(inout) :: flag ! Status flag + END SUBROUTINE PDAFlocal_put_state_lknetf_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocal_assimilate_lknetf(U_collect_state, U_distribute_state, & + U_init_dim_obs, U_obs_op, U_init_obs, U_init_obs_l, U_prepoststep, & + U_prodRinvA_l, U_prodRinvA_hyb_l, U_init_n_domains_p, U_init_dim_l, & + U_init_dim_obs_l, U_g2l_obs, U_init_obsvar, U_init_obsvar_l, & + U_likelihood_l, U_likelihood_hyb_l, U_next_observation, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_init_obs, & ! Initialize PE-local observation vector + U_init_obs_l, & ! Init. observation vector on local analysis domain + U_init_obsvar, & ! Initialize mean observation error variance + U_init_obsvar_l, & ! Initialize local mean observation error variance + U_g2l_obs, & ! Restrict full obs. vector to local analysis domain + U_prodRinvA_l, & ! Provide product R^-1 A on local analysis domain + U_prodRinvA_hyb_l, & ! Provide product R^-1 A on local analysis domain with hybrid weight + U_likelihood_l, & ! Compute likelihood + U_likelihood_hyb_l, & ! Compute likelihood with hybrid weight + U_prepoststep, & ! User supplied pre/poststep routine + U_next_observation, & ! Routine to provide time step, time and dimension + ! of next observation + U_distribute_state ! Routine to distribute a state vector + END SUBROUTINE PDAFlocal_assimilate_lknetf + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocal_assimilate_lknetf_si(flag) + INTEGER, INTENT(inout) :: flag ! Status flag + END SUBROUTINE PDAFlocal_assimilate_lknetf_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocal_put_state_en3dvar_lestkf(U_collect_state, U_init_dim_obs, U_obs_op, & + U_init_obs, U_prodRinvA, & + U_cvt_ens, U_cvt_adj_ens, U_obs_op_lin, U_obs_op_adj, & + U_init_dim_obs_f, U_obs_op_f, U_init_obs_f, U_init_obs_l, U_prodRinvA_l, & + U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, U_g2l_obs, & + U_init_obsvar, U_init_obsvar_l, U_prepoststep, outflag) + INTEGER, INTENT(out) :: outflag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_init_dim_obs, & ! Initialize dimension of observation vector + U_obs_op, & ! Observation operator + U_init_obs, & ! Initialize observation vector + U_prepoststep, & ! User supplied pre/poststep routine + U_prodRinvA, & ! Provide product R^-1 A + U_cvt_ens, & ! Apply control vector transform matrix (ensemble) + U_cvt_adj_ens, & ! Apply adjoint control vector transform matrix (ensemble var) + U_obs_op_lin, & ! Linearized observation operator + U_obs_op_adj ! Adjoint observation operator + EXTERNAL :: U_obs_op_f, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs_f, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_init_obs_f, & ! Initialize PE-local observation vector + U_init_obs_l, & ! Init. observation vector on local analysis domain + U_init_obsvar, & ! Initialize mean observation error variance + U_init_obsvar_l, & ! Initialize local mean observation error variance + U_g2l_obs, & ! Restrict full obs. vector to local analysis domain + U_prodRinvA_l ! Provide product R^-1 A on local analysis domain + END SUBROUTINE PDAFlocal_put_state_en3dvar_lestkf + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocal_assimilate_en3dvar_lestkf(U_collect_state, U_distribute_state, & + U_init_dim_obs, U_obs_op, U_init_obs, U_prodRinvA, & + U_cvt_ens, U_cvt_adj_ens, U_obs_op_lin, U_obs_op_adj, & + U_init_dim_obs_f, U_obs_op_f, U_init_obs_f, U_init_obs_l, U_prodRinvA_l, & + U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, & + U_g2l_obs, U_init_obsvar, U_init_obsvar_l, & + U_prepoststep, U_next_observation, outflag) + INTEGER, INTENT(inout) :: outflag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_init_dim_obs, & ! Initialize dimension of observation vector + U_obs_op, & ! Observation operator + U_init_obsvar, & ! Initialize mean observation error variance + U_init_obs, & ! Initialize observation vector + U_prepoststep, & ! User supplied pre/poststep routine + U_prodRinvA, & ! Provide product R^-1 A + U_next_observation, & ! Routine to provide time step, time and dimension + ! of next observation + U_distribute_state, & ! Routine to distribute a state vector + U_cvt_ens, & ! Apply control vector transform matrix (ensemble) + U_cvt_adj_ens, & ! Apply adjoint control vector transform matrix (ensemble var) + U_cvt, & ! Apply control vector transform matrix to control vector + U_cvt_adj, & ! Apply adjoint control vector transform matrix + U_obs_op_lin, & ! Linearized observation operator + U_obs_op_adj ! Adjoint observation operator + EXTERNAL :: U_obs_op_f, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs_f, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_init_obs_f, & ! Initialize PE-local observation vector + U_init_obs_l, & ! Init. observation vector on local analysis domain + U_init_obsvar_l, & ! Initialize local mean observation error variance + U_g2l_obs, & ! Restrict full obs. vector to local analysis domain + U_prodRinvA_l ! Provide product R^-1 A on local analysis domain + END SUBROUTINE PDAFlocal_assimilate_en3dvar_lestkf + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocal_put_state_hyb3dvar_lestkf(U_collect_state, & + U_init_dim_obs, U_obs_op, U_init_obs, U_prodRinvA, & + U_cvt_ens, U_cvt_adj_ens, U_cvt, U_cvt_adj, U_obs_op_lin, U_obs_op_adj, & + U_init_dim_obs_f, U_obs_op_f, U_init_obs_f, U_init_obs_l, U_prodRinvA_l, & + U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, U_g2l_obs, & + U_init_obsvar, U_init_obsvar_l, U_prepoststep, outflag) + INTEGER, INTENT(out) :: outflag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_init_dim_obs, & ! Initialize dimension of observation vector + U_obs_op, & ! Observation operator + U_init_obs, & ! Initialize observation vector + U_prepoststep, & ! User supplied pre/poststep routine + U_prodRinvA, & ! Provide product R^-1 A + U_cvt_ens, & ! Apply control vector transform matrix (ensemble) + U_cvt_adj_ens, & ! Apply adjoint control vector transform matrix (ensemble var) + U_cvt, & ! Apply control vector transform matrix to control vector + U_cvt_adj, & ! Apply adjoint control vector transform matrix + U_obs_op_lin, & ! Linearized observation operator + U_obs_op_adj ! Adjoint observation operator + EXTERNAL :: U_obs_op_f, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs_f, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_init_obs_f, & ! Initialize PE-local observation vector + U_init_obs_l, & ! Init. observation vector on local analysis domain + U_init_obsvar, & ! Initialize mean observation error variance + U_init_obsvar_l, & ! Initialize local mean observation error variance + U_g2l_obs, & ! Restrict full obs. vector to local analysis domain + U_prodRinvA_l ! Provide product R^-1 A on local analysis domain + END SUBROUTINE PDAFlocal_put_state_hyb3dvar_lestkf + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocal_assimilate_hyb3dvar_lestkf(U_collect_state, U_distribute_state, & + U_init_dim_obs, U_obs_op, U_init_obs, U_prodRinvA, & + U_cvt_ens, U_cvt_adj_ens, U_cvt, U_cvt_adj, U_obs_op_lin, U_obs_op_adj, & + U_init_dim_obs_f, U_obs_op_f, U_init_obs_f, U_init_obs_l, U_prodRinvA_l, & + U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, U_g2l_obs, & + U_init_obsvar, U_init_obsvar_l, U_prepoststep, U_next_observation, outflag) + INTEGER, INTENT(out) :: outflag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_init_dim_obs, & ! Initialize dimension of observation vector + U_obs_op, & ! Observation operator + U_init_obsvar, & ! Initialize mean observation error variance + U_init_obs, & ! Initialize observation vector + U_prepoststep, & ! User supplied pre/poststep routine + U_prodRinvA, & ! Provide product R^-1 A + U_next_observation, & ! Routine to provide time step, time and dimension + ! of next observation + U_distribute_state, & ! Routine to distribute a state vector + U_cvt_ens, & ! Apply control vector transform matrix (ensemble) + U_cvt_adj_ens, & ! Apply adjoint control vector transform matrix (ensemble var) + U_cvt, & ! Apply control vector transform matrix to control vector + U_cvt_adj, & ! Apply adjoint control vector transform matrix + U_obs_op_lin, & ! Linearized observation operator + U_obs_op_adj ! Adjoint observation operator + EXTERNAL :: U_obs_op_f, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs_f, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_init_obs_f, & ! Initialize PE-local observation vector + U_init_obs_l, & ! Init. observation vector on local analysis domain + U_init_obsvar_l, & ! Initialize local mean observation error variance + U_g2l_obs, & ! Restrict full obs. vector to local analysis domain + U_prodRinvA_l ! Provide product R^-1 A on local analysis domain + END SUBROUTINE PDAFlocal_assimilate_hyb3dvar_lestkf + END INTERFACE + +! PDAFlocal INTERFACES --------------------- + + INTERFACE + SUBROUTINE PDAFlocalomi_put_state(U_collect_state, U_init_dim_obs, U_obs_op, & + U_prepoststep, U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, & + flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_prepoststep ! User supplied pre/poststep routine + END SUBROUTINE PDAFlocalomi_put_state + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocalomi_put_state_si(flag) + INTEGER, INTENT(out) :: flag ! Status flag + END SUBROUTINE PDAFlocalomi_put_state_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocalomi_assimilate(U_collect_state, U_distribute_state, & + U_init_dim_obs, U_obs_op, U_prepoststep, U_init_n_domains_p, U_init_dim_l, & + U_l2g_state, U_next_observation, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_distribute_state, & ! Routine to distribute a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_prepoststep, & ! User supplied pre/poststep routine + U_next_observation ! Provide time step and time of next observation + END SUBROUTINE PDAFlocalomi_assimilate + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocalomi_assimilate_si(flag) + INTEGER, INTENT(out) :: flag ! Status flag + END SUBROUTINE PDAFlocalomi_assimilate_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocalomi_put_state_nondiagR(U_collect_state, U_init_dim_obs, U_obs_op, & + U_prepoststep, U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, U_prodRinvA_l, & + flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_prodRinvA_l, & ! Provide product R^-1 A on local analysis domain + U_prepoststep ! User supplied pre/poststep routine + END SUBROUTINE PDAFlocalomi_put_state_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocalomi_put_state_nondiagR_si(flag) + INTEGER, INTENT(out) :: flag ! Status flag + END SUBROUTINE PDAFlocalomi_put_state_nondiagR_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocalomi_assimilate_nondiagR(U_collect_state, U_distribute_state, & + U_init_dim_obs, U_obs_op, U_prepoststep, U_init_n_domains_p, U_init_dim_l, & + U_init_dim_obs_l, U_prodRinvA_l, U_next_observation, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_distribute_state, & ! Routine to distribute a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_prodRinvA_l, & ! Provide product R^-1 A on local analysis domain + U_prepoststep, & ! User supplied pre/poststep routine + U_next_observation ! Provide time step and time of next observation + END SUBROUTINE PDAFlocalomi_assimilate_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocalomi_assimilate_nondiagR_si(flag) + INTEGER, INTENT(out) :: flag ! Status flag + END SUBROUTINE PDAFlocalomi_assimilate_nondiagR_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocalomi_put_state_lnetf_nondiagR(U_collect_state, U_init_dim_obs, U_obs_op, & + U_prepoststep, U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, U_likelihood_l, & + flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_likelihood_l, & ! Compute likelihood and apply localization + U_prepoststep ! User supplied pre/poststep routine + END SUBROUTINE PDAFlocalomi_put_state_lnetf_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocalomi_put_state_lnetf_nondiagR_si(flag) + INTEGER, INTENT(out) :: flag ! Status flag + END SUBROUTINE PDAFlocalomi_put_state_lnetf_nondiagR_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocalomi_assimilate_lnetf_nondiagR(U_collect_state, U_distribute_state, & + U_init_dim_obs, U_obs_op, U_prepoststep, U_init_n_domains_p, U_init_dim_l, & + U_init_dim_obs_l, U_likelihood_l, U_next_observation, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_distribute_state, & ! Routine to distribute a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_likelihood_l, & ! Compute likelihood and apply localization + U_prepoststep, & ! User supplied pre/poststep routine + U_next_observation ! Provide time step and time of next observation + END SUBROUTINE PDAFlocalomi_assimilate_lnetf_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocalomi_assimilate_lnetf_nondiagR_si(flag) + INTEGER, INTENT(out) :: flag ! Status flag + END SUBROUTINE PDAFlocalomi_assimilate_lnetf_nondiagR_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocalomi_put_state_lknetf_nondiagR(U_collect_state, U_init_dim_obs, U_obs_op, & + U_prepoststep, U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, & + U_prodRinvA_l, U_prodRinvA_hyb_l, U_likelihood_l, U_likelihood_hyb_l, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_prodRinvA_l, & ! Provide product R^-1 A on local analysis domain + U_prodRinvA_hyb_l, & ! Product R^-1 A on local analysis domain with hybrid weight + U_likelihood_l, & ! Compute likelihood and apply localization + U_likelihood_hyb_l, & ! Compute likelihood and apply localization with tempering + U_prepoststep ! User supplied pre/poststep routine + END SUBROUTINE PDAFlocalomi_put_state_lknetf_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocalomi_put_state_lknetf_nondiagR_si(flag) + INTEGER, INTENT(out) :: flag ! Status flag + END SUBROUTINE PDAFlocalomi_put_state_lknetf_nondiagR_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocalomi_assimilate_lknetf_nondiagR(U_collect_state, U_distribute_state, & + U_init_dim_obs, U_obs_op, U_prepoststep, U_init_n_domains_p, U_init_dim_l, & + U_init_dim_obs_l, U_prodRinvA_l, U_prodRinvA_hyb_l, U_likelihood_l, U_likelihood_hyb_l, & + U_next_observation, flag) + INTEGER, INTENT(out) :: flag ! Status flag + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_distribute_state, & ! Routine to distribute a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_prodRinvA_l, & ! Provide product R^-1 A on local analysis domain + U_prodRinvA_hyb_l, & ! Product R^-1 A on local analysis domain with hybrid weight + U_likelihood_l, & ! Compute likelihood and apply localization + U_likelihood_hyb_l, & ! Compute likelihood and apply localization with tempering + U_prepoststep, & ! User supplied pre/poststep routine + U_next_observation ! Provide time step and time of next observation + END SUBROUTINE PDAFlocalomi_assimilate_lknetf_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocalomi_assimilate_lknetf_nondiagR_si(flag) + INTEGER, INTENT(out) :: flag ! Status flag + END SUBROUTINE PDAFlocalomi_assimilate_lknetf_nondiagR_si + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocalomi_put_state_en3dvar_lestkf(collect_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & + init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdaf, & + prepoststep_pdaf, outflag) + INTEGER, INTENT(inout) :: outflag ! Status flag + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix + obs_op_lin_pdaf, & ! Linearized observation operator + obs_op_adj_pdaf ! Adjoint observation operator + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector + obs_op_f_pdaf, & ! Full observation operator + init_dim_obs_l_pdaf ! Initialize local dimimension of obs. vector + END SUBROUTINE PDAFlocalomi_put_state_en3dvar_lestkf + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocalomi_assimilate_en3dvar_lestkf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & + init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdaf, & + prepoststep_pdaf, next_observation_pdaf, outflag) + INTEGER, INTENT(inout) :: outflag ! Status flag + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix + obs_op_lin_pdaf, & ! Linearized observation operator + obs_op_adj_pdaf ! Adjoint observation operator + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector + obs_op_f_pdaf, & ! Full observation operator + init_dim_obs_l_pdaf ! Initialize local dimimension of obs. vector + END SUBROUTINE PDAFlocalomi_assimilate_en3dvar_lestkf + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocalomi_put_state_en3dvar_lestkf_nondiagR(collect_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, prodRinvA_pdaf, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & + prodRinvA_l_pdaf, init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdaf, & + prepoststep_pdaf, outflag) + INTEGER, INTENT(inout) :: outflag ! Status flag + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix + obs_op_lin_pdaf, & ! Linearized observation operator + obs_op_adj_pdaf ! Adjoint observation operator + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + prodRinvA_pdaf, & ! Provide product R^-1 A + init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector + obs_op_f_pdaf, & ! Full observation operator + init_dim_obs_l_pdaf, & ! Initialize local dimimension of obs. vector + prodRinvA_l_pdaf ! Provide product R^-1 A with localization + END SUBROUTINE PDAFlocalomi_put_state_en3dvar_lestkf_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocalomi_assimilate_en3dvar_lestkf_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, prodRinvA_pdaf, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & + prodRinvA_l_pdaf, init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdaf, & + prepoststep_pdaf, next_observation_pdaf, outflag) + INTEGER, INTENT(inout) :: outflag ! Status flag + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix + obs_op_lin_pdaf, & ! Linearized observation operator + obs_op_adj_pdaf ! Adjoint observation operator + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + prodRinvA_pdaf, & ! Provide product R^-1 A + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector + obs_op_f_pdaf, & ! Full observation operator + init_dim_obs_l_pdaf, & ! Initialize local dimimension of obs. vector + prodRinvA_l_pdaf ! Provide product R^-1 A with localization + END SUBROUTINE PDAFlocalomi_assimilate_en3dvar_lestkf_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocalomi_put_state_hyb3dvar_lestkf(collect_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, cvt_pdaf, cvt_adj_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & + init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdaf, & + prepoststep_pdaf, outflag) + INTEGER, INTENT(inout) :: outflag ! Status flag + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix + cvt_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_pdaf, & ! Apply adjoint control vector transform matrix + obs_op_lin_pdaf, & ! Linearized observation operator + obs_op_adj_pdaf ! Adjoint observation operator + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector + obs_op_f_pdaf, & ! Full observation operator + init_dim_obs_l_pdaf ! Initialize local dimimension of obs. vector + END SUBROUTINE PDAFlocalomi_put_state_hyb3dvar_lestkf + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocalomi_assimilate_hyb3dvar_lestkf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, cvt_pdaf, cvt_adj_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & + init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdaf, & + prepoststep_pdaf, next_observation_pdaf, outflag) + INTEGER, INTENT(inout) :: outflag ! Status flag + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix + cvt_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_pdaf, & ! Apply adjoint control vector transform matrix + obs_op_lin_pdaf, & ! Linearized observation operator + obs_op_adj_pdaf ! Adjoint observation operator + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector + obs_op_f_pdaf, & ! Full observation operator + init_dim_obs_l_pdaf ! Initialize local dimimension of obs. vector + END SUBROUTINE PDAFlocalomi_assimilate_hyb3dvar_lestkf + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocalomi_put_state_hyb3dvar_lestkf_nondiagR(collect_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, prodRinvA_pdaf, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & + prodRinvA_l_pdaf, init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdaf, & + prepoststep_pdaf, outflag) + INTEGER, INTENT(inout) :: outflag ! Status flag + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix + cvt_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_pdaf, & ! Apply adjoint control vector transform matrix + obs_op_lin_pdaf, & ! Linearized observation operator + obs_op_adj_pdaf ! Adjoint observation operator + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + prodRinvA_pdaf, & ! Provide product R^-1 A + init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector + obs_op_f_pdaf, & ! Full observation operator + init_dim_obs_l_pdaf, & ! Initialize local dimimension of obs. vector + prodRinvA_l_pdaf ! Provide product R^-1 A with localization + END SUBROUTINE PDAFlocalomi_put_state_hyb3dvar_lestkf_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocalomi_assimilate_hyb3dvar_lestkf_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, prodRinvA_pdaf, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, cvt_pdaf, cvt_adj_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & + prodRinvA_l_pdaf, init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdaf, & + prepoststep_pdaf, next_observation_pdaf, outflag) + INTEGER, INTENT(inout) :: outflag ! Status flag + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix + cvt_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_pdaf, & ! Apply adjoint control vector transform matrix + obs_op_lin_pdaf, & ! Linearized observation operator + obs_op_adj_pdaf ! Adjoint observation operator + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + prodRinvA_pdaf, & ! Provide product R^-1 A + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector + obs_op_f_pdaf, & ! Full observation operator + init_dim_obs_l_pdaf, & ! Initialize local dimimension of obs. vector + prodRinvA_l_pdaf ! Provide product R^-1 A with localization + END SUBROUTINE PDAFlocalomi_assimilate_hyb3dvar_lestkf_nondiagR + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocal_set_indices(dim_l, map) + INTEGER, INTENT(in) :: dim_l !< Dimension of local state vector + INTEGER, INTENT(in) :: map(dim_l) !< Index array for mapping + END SUBROUTINE PDAFlocal_set_indices + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocal_set_increment_weights(dim_l, weights) + INTEGER, INTENT(in) :: dim_l !< Dimension of local state vector + REAL, INTENT(in) :: weights(dim_l) !< Weights array + END SUBROUTINE PDAFlocal_set_increment_weights + END INTERFACE + + INTERFACE + SUBROUTINE PDAFlocal_clear_increment_weights() + END SUBROUTINE PDAFlocal_clear_increment_weights + END INTERFACE + +END MODULE PDAFlocal_interfaces diff --git a/src/PDAFlocal_l2g_cb.F90 b/src/PDAFlocal_l2g_cb.F90 new file mode 100644 index 000000000..c64126f98 --- /dev/null +++ b/src/PDAFlocal_l2g_cb.F90 @@ -0,0 +1,78 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocal_l2g_cb - Initialize global vector elements from local state vector +! +! !INTERFACE: +SUBROUTINE PDAFlocal_l2g_cb(step, domain_p, dim_l, state_l, dim_p, state_p) + +! !DESCRIPTION: +! Initialize elements of a global state vector from a local state vector. +! This is the full callback function to be used internally. The mapping +! is done using the index vector id_lstate_in_pstate that is initialize +! in PDAF_local_set_index. +! +! To exclude any element of the local state vector from the initialization +! one can set the corresponding index value to 0. +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + USE PDAFlocal, & + ONLY: id_lstate_in_pstate, l2g_weights + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(in) :: step !< Current time step + INTEGER, INTENT(in) :: domain_p !< Current local analysis domain + INTEGER, INTENT(in) :: dim_l !< Local state dimension + INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension + REAL, INTENT(in) :: state_l(dim_l) !< State vector on local analysis domain + REAL, INTENT(inout) :: state_p(dim_p) !< PE-local full state vector + +! !CALLING SEQUENCE: +! Called by filter routine +!EOP + +! *** local variables *** + INTEGER :: i ! Counter + + +! ************************************************** +! *** Initialize elements of global state vector *** +! ************************************************** + + IF (.NOT.ALLOCATED(l2g_weights)) THEN + ! Initialize global state vector with full updated local state + DO i = 1, dim_l + state_p(id_lstate_in_pstate(i)) = state_l(i) + END DO + ELSE + ! Apply increment weight when initializaing global state vector from local state vector + DO i = 1, dim_l + state_p(id_lstate_in_pstate(i)) = state_p(id_lstate_in_pstate(i)) & + + l2g_weights(i) * (state_l(i) - state_p(id_lstate_in_pstate(i))) + END DO + END IF + +END SUBROUTINE PDAFlocal_l2g_cb diff --git a/src/PDAFlocal_put_state_en3dvar_lestkf.F90 b/src/PDAFlocal_put_state_en3dvar_lestkf.F90 new file mode 100644 index 000000000..f8d27e16c --- /dev/null +++ b/src/PDAFlocal_put_state_en3dvar_lestkf.F90 @@ -0,0 +1,248 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocal_put_state_en3dvar_lestkf --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocal_put_state_en3dvar_lestkf(U_collect_state, U_init_dim_obs, U_obs_op, & + U_init_obs, U_prodRinvA, & + U_cvt_ens, U_cvt_adj_ens, U_obs_op_lin, U_obs_op_adj, & + U_init_dim_obs_f, U_obs_op_f, U_init_obs_f, U_init_obs_l, U_prodRinvA_l, & + U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, & + U_g2l_obs, U_init_obsvar, U_init_obsvar_l, & + U_prepoststep, outflag) + +! !DESCRIPTION: +! Interface routine called from the model after the +! forecast of each ensemble state to transfer data +! from the model to PDAF. For the parallelization +! this involves transfer from model PEs to filter +! PEs.\\ +! During the forecast phase state vectors are +! re-initialized from the forecast model fields +! by U\_collect\_state. +! At the end of a forecast phase (i.e. when all +! ensemble members have been integrated by the model) +! sub-ensembles are gathered from the model tasks. +! Subsequently the filter update is performed. +! +! The code is very generic. Basically the only +! filter-specific part if the call to the +! update-routine PDAF\_X\_update where the analysis +! is computed. The filter-specific subroutines that +! are specified in the call to PDAF\_put\_state\_X +! are passed through to the update routine +! +! Variant for ensemble 3DVAR using LESTKF to +! update the ensemble perturbations. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2021-03 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + USE PDAF_communicate_ens, & + ONLY: PDAF_gather_ens + USE PDAF_timer, & + ONLY: PDAF_timeit, PDAF_time_temp + USE PDAF_memcounting, & + ONLY: PDAF_memcount + USE PDAF_mod_filter, & + ONLY: dim_p, dim_obs, dim_ens, local_dim_ens, & + nsteps, step_obs, step, member, member_save, subtype_filter, & + type_forget, incremental, initevol, state, eofV, & + eofU, state_inc, forget, screen, flag, & + dim_cvec_ens, type_opt, offline_mode + USE PDAF_mod_filtermpi, & + ONLY: mype_world, filterpe, & + dim_ens_l, modelpe, filter_no_model + USE PDAFlocal, & + ONLY: PDAFlocal_g2l_cb, & ! Project global to local state vector + PDAFlocal_l2g_cb ! Project local to global state vecto + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(out) :: outflag ! Status flag + +! ! External subroutines +! ! (PDAF-internal names, real names are defined in the call to PDAF) + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_init_dim_obs, & ! Initialize dimension of observation vector + U_obs_op, & ! Observation operator + U_init_obs, & ! Initialize observation vector + U_prepoststep, & ! User supplied pre/poststep routine + U_prodRinvA, & ! Provide product R^-1 A + U_cvt_ens, & ! Apply control vector transform matrix (ensemble) + U_cvt_adj_ens, & ! Apply adjoint control vector transform matrix (ensemble var) + U_obs_op_lin, & ! Linearized observation operator + U_obs_op_adj ! Adjoint observation operator + EXTERNAL :: U_obs_op_f, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs_f, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_init_obs_f, & ! Initialize PE-local observation vector + U_init_obs_l, & ! Init. observation vector on local analysis domain + U_init_obsvar, & ! Initialize mean observation error variance + U_init_obsvar_l, & ! Initialize local mean observation error variance + U_g2l_obs, & ! Restrict full obs. vector to local analysis domain + U_prodRinvA_l ! Provide product R^-1 A on local analysis domain + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: U_collect_state +! Calls: PDAF_gather_ens +! Calls: PDAF_3dvar_update +! Calls: PDAF_timeit +!EOP + +! local variables + INTEGER :: i ! Counter + INTEGER, SAVE :: allocflag = 0 ! Flag whether first time allocation is done + + +! ************************************************** +! *** Save forecasted state back to the ensemble *** +! *** Only done on the filter Pes *** +! ************************************************** + + doevol: IF (nsteps > 0 .OR. .NOT.offline_mode) THEN + + CALL PDAF_timeit(41, 'new') + + modelpes: IF (modelpe) THEN + + ! Store member index for PDAF_get_memberid + member_save = member + + IF (subtype_filter /= 2 .AND. subtype_filter /= 3) THEN + ! Save evolved state in ensemble matrix + CALL U_collect_state(dim_p, eofV(1 : dim_p, member)) + ELSE + ! Save evolved ensemble mean state + CALL U_collect_state(dim_p, state(1:dim_p)) + END IF + END IF modelpes + + CALL PDAF_timeit(41, 'old') + + member = member + 1 + ELSE + member = local_dim_ens + 1 + END IF doevol + + IF (filter_no_model .AND. filterpe) THEN + member = local_dim_ens + 1 + END IF + + +! ******************************************************** +! *** When forecast phase is completed *** +! *** - collect forecast sub_ensembles on filter PEs *** +! *** - perform analysis step *** +! *** - re-initialize forecast counters/flags *** +! ******************************************************** + completeforecast: IF (member == local_dim_ens + 1 & + .OR. offline_mode) THEN + + ! *********************************************** + ! *** Collect forecast ensemble on filter PEs *** + ! *********************************************** + + doevolB: IF (nsteps > 0) THEN + + IF (.not.filterpe) THEN + ! Non filter PEs only store a sub-ensemble + CALL PDAF_gather_ens(dim_p, dim_ens_l, eofV, screen) + ELSE + ! On filter PEs, the ensemble array has full size + CALL PDAF_gather_ens(dim_p, dim_ens, eofV, screen) + END IF + + END IF doevolB + + ! *** call timer + CALL PDAF_timeit(2, 'old') + + IF (.NOT.offline_mode .AND. mype_world == 0 .AND. screen > 1) THEN + WRITE (*, '(a, 5x, a, F10.3, 1x, a)') & + 'PDAF', '--- duration of forecast phase:', PDAF_time_temp(2), 's' + END IF + + + ! ************************************** + ! *** Perform analysis on filter PEs *** + ! ************************************** + + ! Screen output + IF (offline_mode .AND. mype_world == 0 .AND. screen > 0) THEN + WRITE (*, '(//a5, 64a)') 'PDAF ',('-', i = 1, 64) + WRITE (*, '(a, 20x, a)') 'PDAF', '+++++ ASSIMILATION +++++' + WRITE (*, '(a5, 64a)') 'PDAF ', ('-', i = 1, 64) + ENDIF + + OnFilterPE: IF (filterpe) THEN + + IF (incremental == 0) THEN + ! Allocate only if no incremental updating is used. + ! With incremental STATE_INC is allocated in PDAF_filter_init. + ALLOCATE(state_inc(dim_p)) + IF (allocflag == 0) THEN + CALL PDAF_memcount(3, 'r', dim_p) + allocflag = 1 + END IF + END IF + + CALL PDAF_en3dvar_update_lestkf(step_obs, dim_p, dim_obs, dim_ens, & + dim_cvec_ens, state, eofU, eofV, state_inc, forget, & + U_init_dim_obs, U_obs_op, U_init_obs, U_prodRinvA, U_prepoststep, & + U_cvt_ens, U_cvt_adj_ens, U_obs_op_lin, U_obs_op_adj, & + U_init_dim_obs_f, U_obs_op_f, U_init_obs_f, U_init_obs_l, U_prodRinvA_l, & + U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, PDAFlocal_g2l_cb, & + PDAFlocal_l2g_cb, U_g2l_obs, U_init_obsvar, U_init_obsvar_l, & + screen, subtype_filter, incremental, type_forget, type_opt, & + flag) + + IF (incremental == 0) DEALLOCATE(state_inc) + + END IF OnFilterPE + + + ! *********************************** + ! *** Set forecast counters/flags *** + ! *********************************** + initevol = 1 + member = 1 + step = step_obs + 1 + + END IF completeforecast + + +! ******************** +! *** finishing up *** +! ******************** + + outflag = flag + +END SUBROUTINE PDAFlocal_put_state_en3dvar_lestkf diff --git a/src/PDAFlocal_put_state_hyb3dvar_lestkf.F90 b/src/PDAFlocal_put_state_hyb3dvar_lestkf.F90 new file mode 100644 index 000000000..a59505c49 --- /dev/null +++ b/src/PDAFlocal_put_state_hyb3dvar_lestkf.F90 @@ -0,0 +1,250 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocal_put_state_hyb3dvar_lestkf --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocal_put_state_hyb3dvar_lestkf(U_collect_state, & + U_init_dim_obs, U_obs_op, U_init_obs, U_prodRinvA, & + U_cvt_ens, U_cvt_adj_ens, U_cvt, U_cvt_adj, U_obs_op_lin, U_obs_op_adj, & + U_init_dim_obs_f, U_obs_op_f, U_init_obs_f, U_init_obs_l, U_prodRinvA_l, & + U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, & + U_g2l_obs, U_init_obsvar, U_init_obsvar_l, & + U_prepoststep, outflag) + +! !DESCRIPTION: +! Interface routine called from the model after the +! forecast of each ensemble state to transfer data +! from the model to PDAF. For the parallelization +! this involves transfer from model PEs to filter +! PEs.\\ +! During the forecast phase state vectors are +! re-initialized from the forecast model fields +! by U\_collect\_state. +! At the end of a forecast phase (i.e. when all +! ensemble members have been integrated by the model) +! sub-ensembles are gathered from the model tasks. +! Subsequently the filter update is performed. +! +! The code is very generic. Basically the only +! filter-specific part if the call to the +! update-routine PDAF\_X\_update where the analysis +! is computed. The filter-specific subroutines that +! are specified in the call to PDAF\_put\_state\_X +! are passed through to the update routine +! +! Variant for hybrid 3DVAR using LESTKF to +! update the ensemble perturbations. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2021-03 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + USE PDAF_communicate_ens, & + ONLY: PDAF_gather_ens + USE PDAF_timer, & + ONLY: PDAF_timeit, PDAF_time_temp + USE PDAF_memcounting, & + ONLY: PDAF_memcount + USE PDAF_mod_filter, & + ONLY: dim_p, dim_obs, dim_ens, local_dim_ens, & + nsteps, step_obs, step, member, member_save, subtype_filter, & + type_forget, incremental, initevol, state, eofV, & + eofU, state_inc, forget, screen, flag, & + dim_cvec, dim_cvec_ens, type_opt, offline_mode + USE PDAF_mod_filtermpi, & + ONLY: mype_world, filterpe, & + dim_ens_l, modelpe, filter_no_model + USE PDAFlocal, & + ONLY: PDAFlocal_g2l_cb, & ! Project global to local state vector + PDAFlocal_l2g_cb ! Project local to global state vector + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(out) :: outflag ! Status flag + +! ! External subroutines +! ! (PDAF-internal names, real names are defined in the call to PDAF) + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_init_dim_obs, & ! Initialize dimension of observation vector + U_obs_op, & ! Observation operator + U_init_obs, & ! Initialize observation vector + U_prepoststep, & ! User supplied pre/poststep routine + U_prodRinvA, & ! Provide product R^-1 A + U_cvt_ens, & ! Apply control vector transform matrix (ensemble) + U_cvt_adj_ens, & ! Apply adjoint control vector transform matrix (ensemble var) + U_cvt, & ! Apply control vector transform matrix to control vector + U_cvt_adj, & ! Apply adjoint control vector transform matrix + U_obs_op_lin, & ! Linearized observation operator + U_obs_op_adj ! Adjoint observation operator + EXTERNAL :: U_obs_op_f, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs_f, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_init_obs_f, & ! Initialize PE-local observation vector + U_init_obs_l, & ! Init. observation vector on local analysis domain + U_init_obsvar, & ! Initialize mean observation error variance + U_init_obsvar_l, & ! Initialize local mean observation error variance + U_g2l_obs, & ! Restrict full obs. vector to local analysis domain + U_prodRinvA_l ! Provide product R^-1 A on local analysis domain + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: U_collect_state +! Calls: PDAF_gather_ens +! Calls: PDAF_3dvar_update +! Calls: PDAF_timeit +!EOP + +! local variables + INTEGER :: i ! Counter + INTEGER, SAVE :: allocflag = 0 ! Flag whether first time allocation is done + + +! ************************************************** +! *** Save forecasted state back to the ensemble *** +! *** Only done on the filter Pes *** +! ************************************************** + + doevol: IF (nsteps > 0 .OR. .NOT.offline_mode) THEN + + CALL PDAF_timeit(41, 'new') + + modelpes: IF (modelpe) THEN + + ! Store member index for PDAF_get_memberid + member_save = member + + IF (subtype_filter /= 2 .AND. subtype_filter /= 3) THEN + ! Save evolved state in ensemble matrix + CALL U_collect_state(dim_p, eofV(1 : dim_p, member)) + ELSE + ! Save evolved ensemble mean state + CALL U_collect_state(dim_p, state(1:dim_p)) + END IF + END IF modelpes + + CALL PDAF_timeit(41, 'old') + + member = member + 1 + ELSE + member = local_dim_ens + 1 + END IF doevol + + IF (filter_no_model .AND. filterpe) THEN + member = local_dim_ens + 1 + END IF + + +! ******************************************************** +! *** When forecast phase is completed *** +! *** - collect forecast sub_ensembles on filter PEs *** +! *** - perform analysis step *** +! *** - re-initialize forecast counters/flags *** +! ******************************************************** + completeforecast: IF (member == local_dim_ens + 1 & + .OR. offline_mode) THEN + + ! *********************************************** + ! *** Collect forecast ensemble on filter PEs *** + ! *********************************************** + + doevolB: IF (nsteps > 0) THEN + + IF (.not.filterpe) THEN + ! Non filter PEs only store a sub-ensemble + CALL PDAF_gather_ens(dim_p, dim_ens_l, eofV, screen) + ELSE + ! On filter PEs, the ensemble array has full size + CALL PDAF_gather_ens(dim_p, dim_ens, eofV, screen) + END IF + + END IF doevolB + + ! *** call timer + CALL PDAF_timeit(2, 'old') + + IF (.NOT.offline_mode .AND. mype_world == 0 .AND. screen > 1) THEN + WRITE (*, '(a, 5x, a, F10.3, 1x, a)') & + 'PDAF', '--- duration of forecast phase:', PDAF_time_temp(2), 's' + END IF + + + ! ************************************** + ! *** Perform analysis on filter PEs *** + ! ************************************** + + ! Screen output + IF (offline_mode .AND. mype_world == 0 .AND. screen > 0) THEN + WRITE (*, '(//a5, 64a)') 'PDAF ',('-', i = 1, 64) + WRITE (*, '(a, 20x, a)') 'PDAF', '+++++ ASSIMILATION +++++' + WRITE (*, '(a5, 64a)') 'PDAF ', ('-', i = 1, 64) + ENDIF + + OnFilterPE: IF (filterpe) THEN + + IF (incremental == 0) THEN + ! Allocate only if no incremental updating is used. + ! With incremental STATE_INC is allocated in PDAF_filter_init. + ALLOCATE(state_inc(dim_p)) + IF (allocflag == 0) THEN + CALL PDAF_memcount(3, 'r', dim_p) + allocflag = 1 + END IF + END IF + + CALL PDAF_hyb3dvar_update_lestkf(step_obs, dim_p, dim_obs, dim_ens, & + dim_cvec, dim_cvec_ens, state, eofU, eofV, state_inc, forget, & + U_init_dim_obs, U_obs_op, U_init_obs, U_prodRinvA, U_prepoststep, & + U_cvt_ens, U_cvt_adj_ens, U_cvt, U_cvt_adj, U_obs_op_lin, U_obs_op_adj, & + U_init_dim_obs_f, U_obs_op_f, U_init_obs_f, U_init_obs_l, U_prodRinvA_l, & + U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, PDAFlocal_g2l_cb, & + PDAFlocal_l2g_cb, U_g2l_obs, U_init_obsvar, U_init_obsvar_l, & + screen, subtype_filter, incremental, type_forget, type_opt, & + flag) + + IF (incremental == 0) DEALLOCATE(state_inc) + + END IF OnFilterPE + + + ! *********************************** + ! *** Set forecast counters/flags *** + ! *********************************** + initevol = 1 + member = 1 + step = step_obs + 1 + + END IF completeforecast + + +! ******************** +! *** finishing up *** +! ******************** + + outflag = flag + +END SUBROUTINE PDAFlocal_put_state_hyb3dvar_lestkf diff --git a/src/PDAFlocal_put_state_lestkf.F90 b/src/PDAFlocal_put_state_lestkf.F90 new file mode 100644 index 000000000..7136d4349 --- /dev/null +++ b/src/PDAFlocal_put_state_lestkf.F90 @@ -0,0 +1,216 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! The code is very generic. Basically the only +! filter-specific part if the call to the +! update-routine PDAF\_X\_update where the analysis +! is computed. The filter-specific subroutines that +! are specified in the call to PDAF\_put\_state\_X +! are passed through to the update routine +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocal_put_state_lestkf --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocal_put_state_lestkf(U_collect_state, U_init_dim_obs, U_obs_op, & + U_init_obs, U_init_obs_l, U_prepoststep, U_prodRinvA_l, U_init_n_domains_p, & + U_init_dim_l, U_init_dim_obs_l, U_g2l_obs, & + U_init_obsvar, U_init_obsvar_l, outflag) + +! !DESCRIPTION: +! Interface routine called from the model after the +! forecast of each ensemble state to transfer data +! from the model to PDAF. For the parallelization +! this involves transfer from model PEs to filter +! PEs.\\ +! During the forecast phase state vectors are +! re-initialized from the forecast model fields +! by U\_collect\_state. +! At the end of a forecast phase (i.e. when all +! ensemble members have been integrated by the model) +! sub-ensembles are gathered from the model tasks. +! Subsequently the filter update is performed. +! +! Variant for LESTKF with domain decomposition. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2011-09 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + USE PDAF_communicate_ens, & + ONLY: PDAF_gather_ens + USE PDAF_timer, & + ONLY: PDAF_timeit, PDAF_time_temp + USE PDAF_mod_filter, & + ONLY: dim_p, dim_obs, dim_ens, rank, local_dim_ens, & + nsteps, step_obs, step, member, member_save, subtype_filter, & + type_forget, incremental, initevol, state, eofV, & + eofU, state_inc, screen, flag, & + type_sqrt, sens, dim_lag, cnt_maxlag, offline_mode + USE PDAF_mod_filtermpi, & + ONLY: mype_world, filterpe, dim_ens_l, modelpe, filter_no_model + USE PDAFlocal, & + ONLY: PDAFlocal_g2l_cb, & ! Project global to local state vector + PDAFlocal_l2g_cb ! Project local to global state vecto + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(out) :: outflag ! Status flag + +! ! External subroutines +! ! (PDAF-internal names, real names are defined in the call to PDAF) + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_init_obs, & ! Initialize PE-local observation vector + U_init_obs_l, & ! Init. observation vector on local analysis domain + U_init_obsvar, & ! Initialize mean observation error variance + U_init_obsvar_l, & ! Initialize local mean observation error variance + U_g2l_obs, & ! Restrict full obs. vector to local analysis domain + U_prodRinvA_l, & ! Provide product R^-1 A on local analysis domain + U_prepoststep ! User supplied pre/poststep routine + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: U_collect_state +! Calls: PDAF_gather_ens +! Calls: PDAF_lestkf_update +! Calls: PDAF_timeit +!EOP + +! local variables + INTEGER :: i ! Counter + + +! ************************************************** +! *** Save forecast state back to the ensemble *** +! *** Only done on the filter Pes *** +! ************************************************** + + doevol: IF (nsteps > 0) THEN + + CALL PDAF_timeit(41, 'new') + + modelpes: IF (modelpe) THEN + + ! Store member index for PDAF_get_memberid + member_save = member + + IF (subtype_filter /= 2 .AND. subtype_filter /= 3) THEN + ! Save evolved state in ensemble matrix + CALL U_collect_state(dim_p, eofV(1 : dim_p, member)) + ELSE + ! Save evolved ensemble mean state + CALL U_collect_state(dim_p, state(1 : dim_p)) + END IF + END IF modelpes + + CALL PDAF_timeit(41, 'old') + + member = member + 1 + ELSE + member = local_dim_ens + 1 + END IF doevol + + IF (filter_no_model .AND. filterpe) THEN + member = local_dim_ens + 1 + END IF + + +! ******************************************************** +! *** When forecast phase is completed *** +! *** - collect forecast sub_ensembles on filter PEs *** +! *** - perform analysis step *** +! *** - re-initialize forecast counters/flags *** +! ******************************************************** + completeforecast: IF (member == local_dim_ens + 1 & + .OR. offline_mode) THEN + + ! *********************************************** + ! *** Collect forecast ensemble on filter PEs *** + ! *********************************************** + + doevolB: IF (nsteps > 0) THEN + + IF (.not.filterpe) THEN + ! Non filter PEs only store a sub-ensemble + CALL PDAF_gather_ens(dim_p, dim_ens_l, eofV, screen) + ELSE + ! On filter PEs, the ensemble array has full size + CALL PDAF_gather_ens(dim_p, dim_ens, eofV, screen) + END IF + + end IF doevolB + + ! *** call timer + CALL PDAF_timeit(2, 'old') + + IF (.NOT.offline_mode .AND. mype_world == 0 .AND. screen > 1) THEN + WRITE (*, '(a, 5x, a, F10.3, 1x, a)') & + 'PDAF', '--- duration of forecast phase:', PDAF_time_temp(2), 's' + END IF + + + ! ************************************** + ! *** Perform analysis on filter PEs *** + ! ************************************** + + ! Screen output + IF (offline_mode .AND. mype_world == 0 .AND. screen > 0) THEN + WRITE (*, '(//a5, 64a)') 'PDAF ',('-', i = 1, 64) + WRITE (*, '(a, 20x, a)') 'PDAF', '+++++ ASSIMILATION +++++' + WRITE (*, '(a5, 64a)') 'PDAF ', ('-', i = 1, 64) + ENDIF + + OnFilterPE: IF (filterpe) THEN + CALL PDAF_lestkf_update(step_obs, dim_p, dim_obs, dim_ens, rank, state, & + eofU, eofV, state_inc, U_init_dim_obs, & + U_obs_op, U_init_obs, U_init_obs_l, U_prodRinvA_l, U_init_n_domains_p, & + U_init_dim_l, U_init_dim_obs_l, PDAFlocal_g2l_cb, & + PDAFlocal_l2g_cb, U_g2l_obs, U_init_obsvar, U_init_obsvar_l, U_prepoststep, screen, subtype_filter, & + incremental, type_forget, type_sqrt, dim_lag, sens, & + cnt_maxlag, flag) + END IF OnFilterPE + + + ! *********************************** + ! *** Set forecast counters/flags *** + ! *********************************** + initevol = 1 + member = 1 + step = step_obs + 1 + + END IF completeforecast + + +! ******************** +! *** finishing up *** +! ******************** + + outflag = flag + +END SUBROUTINE PDAFlocal_put_state_lestkf diff --git a/src/PDAFlocal_put_state_lestkf_si.F90 b/src/PDAFlocal_put_state_lestkf_si.F90 new file mode 100644 index 000000000..9da7687e0 --- /dev/null +++ b/src/PDAFlocal_put_state_lestkf_si.F90 @@ -0,0 +1,82 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocal_put_state_lestkf_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocal_put_state_lestkf_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model after the +! forecast of each ensemble state to transfer data +! from the model to PDAF. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! Variant for LESTKF with domain decomposition. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2011-09 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + obs_op_f_pdaf, & ! Full observation operator + init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector + init_dim_obs_l_pdaf, & ! Initialize local dimimension of obs. vector + init_obs_f_pdaf, & ! Initialize full observation vector + init_obs_l_pdaf, & ! Initialize local observation vector + init_obsvar_pdaf, & ! Initialize mean observation error variance + init_obsvar_l_pdaf, & ! Initialize local mean observation error variance + g2l_obs_pdaf, & ! Restrict full obs. vector to local analysis domain + prodRinvA_l_pdaf, & ! Provide product R^-1 A on local analysis domain + prepoststep_pdaf ! User supplied pre/poststep routine + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFlocal_put_state_lestkf +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFlocal_put_state_lestkf(collect_state_pdaf, init_dim_obs_f_pdaf, & + obs_op_f_pdaf, init_obs_f_pdaf, init_obs_l_pdaf, prepoststep_pdaf, & + prodRinvA_l_pdaf, init_n_domains_pdaf, init_dim_l_pdaf, & + init_dim_obs_l_pdaf, g2l_obs_pdaf, init_obsvar_pdaf, init_obsvar_l_pdaf, outflag) + +END SUBROUTINE PDAFlocal_put_state_lestkf_si diff --git a/src/PDAFlocal_put_state_letkf.F90 b/src/PDAFlocal_put_state_letkf.F90 new file mode 100644 index 000000000..aca627599 --- /dev/null +++ b/src/PDAFlocal_put_state_letkf.F90 @@ -0,0 +1,216 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocal_put_state_letkf --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocal_put_state_letkf(U_collect_state, U_init_dim_obs, U_obs_op, & + U_init_obs, U_init_obs_l, U_prepoststep, U_prodRinvA_l, U_init_n_domains_p, & + U_init_dim_l, U_init_dim_obs_l, U_g2l_obs, & + U_init_obsvar, U_init_obsvar_l, outflag) + +! !DESCRIPTION: +! Interface routine called from the model after the +! forecast of each ensemble state to transfer data +! from the model to PDAF. For the parallelization +! this involves transfer from model PEs to filter +! PEs.\\ +! During the forecast phase state vectors are +! re-initialized from the forecast model fields +! by U\_collect\_state. +! At the end of a forecast phase (i.e. when all +! ensemble members have been integrated by the model) +! sub-ensembles are gathered from the model tasks. +! Subsequently the filter update is performed. +! +! The code is very generic. Basically the only +! filter-specific part if the call to the +! update-routine PDAF\_X\_update where the analysis +! is computed. The filter-specific subroutines that +! are specified in the call to PDAF\_put\_state\_X +! are passed through to the update routine +! +! Variant for LETKF with domain decomposition. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2009-07 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + USE PDAF_communicate_ens, & + ONLY: PDAF_gather_ens + USE PDAF_timer, & + ONLY: PDAF_timeit, PDAF_time_temp + USE PDAF_mod_filter, & + ONLY: dim_p, dim_obs, dim_ens, local_dim_ens, & + nsteps, step_obs, step, member, member_save, subtype_filter, & + type_forget, incremental, initevol, state, eofV, & + eofU, state_inc, screen, flag, & + sens, dim_lag, cnt_maxlag, offline_mode + USE PDAF_mod_filtermpi, & + ONLY: mype_world, filterpe, dim_ens_l, modelpe, filter_no_model + USE PDAFlocal, & + ONLY: PDAFlocal_g2l_cb, & ! Project global to local state vector + PDAFlocal_l2g_cb ! Project local to global state vecto + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(out) :: outflag ! Status flag + +! ! External subroutines +! ! (PDAF-internal names, real names are defined in the call to PDAF) + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_init_obs, & ! Initialize PE-local observation vector + U_init_obs_l, & ! Init. observation vector on local analysis domain + U_init_obsvar, & ! Initialize mean observation error variance + U_init_obsvar_l, & ! Initialize local mean observation error variance + U_g2l_obs, & ! Restrict full obs. vector to local analysis domain + U_prodRinvA_l, & ! Provide product R^-1 A on local analysis domain + U_prepoststep ! User supplied pre/poststep routine + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: U_collect_state +! Calls: PDAF_gather_ens +! Calls: PDAF_letkf_update +! Calls: PDAF_timeit +!EOP + +! local variables + INTEGER :: i ! Counter + + +! ************************************************** +! *** Save forecast state back to the ensemble *** +! *** Only done on the filter Pes *** +! ************************************************** + + doevol: IF (nsteps > 0) THEN + + CALL PDAF_timeit(41, 'new') + + modelpes: IF (modelpe) THEN + + ! Store member index for PDAF_get_memberid + member_save = member + + IF (subtype_filter /= 2 .AND. subtype_filter /= 3) THEN + ! Save evolved state in ensemble matrix + CALL U_collect_state(dim_p, eofV(1 : dim_p, member)) + ELSE + ! Save evolved ensemble mean state + CALL U_collect_state(dim_p, state(1 : dim_p)) + END IF + END IF modelpes + + CALL PDAF_timeit(41, 'old') + + member = member + 1 + ELSE + member = local_dim_ens + 1 + END IF doevol + + IF (filter_no_model .AND. filterpe) THEN + member = local_dim_ens + 1 + END IF + + +! ******************************************************** +! *** When forecast phase is completed *** +! *** - collect forecast sub_ensembles on filter PEs *** +! *** - perform analysis step *** +! *** - re-initialize forecast counters/flags *** +! ******************************************************** + completeforecast: IF (member == local_dim_ens + 1 & + .OR. offline_mode) THEN + + ! *********************************************** + ! *** Collect forecast ensemble on filter PEs *** + ! *********************************************** + + doevolB: IF (nsteps > 0) THEN + + IF (.not.filterpe) THEN + ! Non filter PEs only store a sub-ensemble + CALL PDAF_gather_ens(dim_p, dim_ens_l, eofV, screen) + ELSE + ! On filter PEs, the ensemble array has full size + CALL PDAF_gather_ens(dim_p, dim_ens, eofV, screen) + END IF + + END IF doevolB + + ! *** call timer + CALL PDAF_timeit(2, 'old') + + IF (.NOT.offline_mode .AND. mype_world == 0 .AND. screen > 1) THEN + WRITE (*, '(a, 5x, a, F10.3, 1x, a)') & + 'PDAF', '--- duration of forecast phase:', PDAF_time_temp(2), 's' + END IF + + + ! ************************************** + ! *** Perform analysis on filter PEs *** + ! ************************************** + + ! Screen output + IF (offline_mode .AND. mype_world == 0 .AND. screen > 0) THEN + WRITE (*, '(//a5, 64a)') 'PDAF ',('-', i = 1, 64) + WRITE (*, '(a, 20x, a)') 'PDAF', '+++++ ASSIMILATION +++++' + WRITE (*, '(a5, 64a)') 'PDAF ', ('-', i = 1, 64) + ENDIF + + OnFilterPE: IF (filterpe) THEN + CALL PDAF_letkf_update(step_obs, dim_p, dim_obs, dim_ens, state, & + eofU, eofV, state_inc, U_init_dim_obs, & + U_obs_op, U_init_obs, U_init_obs_l, U_prodRinvA_l, U_init_n_domains_p, & + U_init_dim_l, U_init_dim_obs_l, PDAFlocal_g2l_cb, & + PDAFlocal_l2g_cb, U_g2l_obs, & + U_init_obsvar, U_init_obsvar_l, U_prepoststep, screen, subtype_filter, & + incremental, type_forget, dim_lag, sens, cnt_maxlag, flag) + END IF OnFilterPE + + + ! *********************************** + ! *** Set forecast counters/flags *** + ! *********************************** + initevol = 1 + member = 1 + step = step_obs + 1 + + END IF completeforecast + + +! ******************** +! *** finishing up *** +! ******************** + + outflag = flag + +END SUBROUTINE PDAFlocal_put_state_letkf diff --git a/src/PDAFlocal_put_state_letkf_si.F90 b/src/PDAFlocal_put_state_letkf_si.F90 new file mode 100644 index 000000000..0b5a64d7e --- /dev/null +++ b/src/PDAFlocal_put_state_letkf_si.F90 @@ -0,0 +1,82 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocal_put_state_letkf_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocal_put_state_letkf_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model after the +! forecast of each ensemble state to transfer data +! from the model to PDAF. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! Variant for LETKF with domain decomposition. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2010-07 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + obs_op_f_pdaf, & ! Full observation operator + init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector + init_dim_obs_l_pdaf, & ! Initialize local dimimension of obs. vector + init_obs_f_pdaf, & ! Initialize full observation vector + init_obs_l_pdaf, & ! Initialize local observation vector + init_obsvar_pdaf, & ! Initialize mean observation error variance + init_obsvar_l_pdaf, & ! Initialize local mean observation error variance + g2l_obs_pdaf, & ! Restrict full obs. vector to local analysis domain + prodRinvA_l_pdaf, & ! Provide product R^-1 A on local analysis domain + prepoststep_pdaf ! User supplied pre/poststep routine + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFlocal_put_state_letkf +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFlocal_put_state_letkf(collect_state_pdaf, init_dim_obs_f_pdaf, & + obs_op_f_pdaf, init_obs_f_pdaf, init_obs_l_pdaf, prepoststep_pdaf, & + prodRinvA_l_pdaf, init_n_domains_pdaf, init_dim_l_pdaf, & + init_dim_obs_l_pdaf, g2l_obs_pdaf, init_obsvar_pdaf, init_obsvar_l_pdaf, outflag) + +END SUBROUTINE PDAFlocal_put_state_letkf_si diff --git a/src/PDAFlocal_put_state_lknetf.F90 b/src/PDAFlocal_put_state_lknetf.F90 new file mode 100644 index 000000000..9bb67c417 --- /dev/null +++ b/src/PDAFlocal_put_state_lknetf.F90 @@ -0,0 +1,232 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocal_put_state_lknetf --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocal_put_state_lknetf(U_collect_state, U_init_dim_obs, U_obs_op, & + U_init_obs, U_init_obs_l, U_prepoststep, U_prodRinvA_l, U_prodRinvA_hyb_l, & + U_init_n_domains_p, & + U_init_dim_l, U_init_dim_obs_l, U_g2l_obs, & + U_init_obsvar, U_init_obsvar_l, U_likelihood_l, U_likelihood_hyb_l, outflag) + +! !DESCRIPTION: +! Interface routine called from the model after the +! forecast of each ensemble state to transfer data +! from the model to PDAF. For the parallelization +! this involves transfer from model PEs to filter +! PEs.\\ +! During the forecast phase state vectors are +! re-initialized from the forecast model fields +! by U\_collect\_state. +! At the end of a forecast phase (i.e. when all +! ensemble members have been integrated by the model) +! sub-ensembles are gathered from the model tasks. +! Subsequently the filter update is performed. +! +! The code is very generic. Basically the only +! filter-specific part if the call to the +! update-routine PDAF\_X\_update where the analysis +! is computed. The filter-specific subroutines that +! are specified in the call to PDAF\_put\_state\_X +! are passed through to the update routine +! +! Variant for LKNETF with domain decomposition. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2017-08 - Lars Nerger - Initial code based on LETKF +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + USE PDAF_communicate_ens, & + ONLY: PDAF_gather_ens + USE PDAF_timer, & + ONLY: PDAF_timeit, PDAF_time_temp + USE PDAF_mod_filter, & + ONLY: dim_p, dim_obs, dim_ens, local_dim_ens, & + nsteps, step_obs, step, member, member_save, subtype_filter, & + type_forget, incremental, initevol, state, eofV, & + eofU, state_inc, screen, flag, & + sens, dim_lag, cnt_maxlag, offline_mode + USE PDAF_mod_filtermpi, & + ONLY: mype_world, filterpe, dim_ens_l, modelpe, filter_no_model + USE PDAFlocal, & + ONLY: PDAFlocal_g2l_cb, & ! Project global to local state vector + PDAFlocal_l2g_cb ! Project local to global state vecto + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(out) :: outflag ! Status flag + +! ! External subroutines +! ! (PDAF-internal names, real names are defined in the call to PDAF) + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_init_obs, & ! Initialize PE-local observation vector + U_init_obs_l, & ! Init. observation vector on local analysis domain + U_init_obsvar, & ! Initialize mean observation error variance + U_init_obsvar_l, & ! Initialize local mean observation error variance + U_g2l_obs, & ! Restrict full obs. vector to local analysis domain + U_prodRinvA_l, & ! Provide product R^-1 A on local analysis domain + U_prodRinvA_hyb_l, & ! Provide product R^-1 A on local analysis domain with hybrid weight + U_likelihood_l, & ! Compute likelihood + U_likelihood_hyb_l, & ! Compute likelihood with hybrid weight + U_prepoststep ! User supplied pre/poststep routine + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: U_collect_state +! Calls: PDAF_gather_ens +! Calls: PDAF_lknetf_update +! Calls: PDAF_timeit +!EOP + +! local variables + INTEGER :: i ! Counter + + +! ************************************************** +! *** Save forecast state back to the ensemble *** +! *** Only done on the filter Pes *** +! ************************************************** + + doevol: IF (nsteps > 0) THEN + + CALL PDAF_timeit(41, 'new') + + modelpes: IF (modelpe) THEN + + ! Store member index for PDAF_get_memberid + member_save = member + + IF (subtype_filter /= 2 .AND. subtype_filter /= 3) THEN + ! Save evolved state in ensemble matrix + CALL U_collect_state(dim_p, eofV(1 : dim_p, member)) + ELSE + ! Save evolved ensemble mean state + CALL U_collect_state(dim_p, state(1 : dim_p)) + END IF + END IF modelpes + + CALL PDAF_timeit(41, 'old') + + member = member + 1 + ELSE + member = local_dim_ens + 1 + END IF doevol + + IF (filter_no_model .AND. filterpe) THEN + member = local_dim_ens + 1 + END IF + + +! ******************************************************** +! *** When forecast phase is completed *** +! *** - collect forecast sub_ensembles on filter PEs *** +! *** - perform analysis step *** +! *** - re-initialize forecast counters/flags *** +! ******************************************************** + completeforecast: IF (member == local_dim_ens + 1 & + .OR. offline_mode) THEN + + ! *********************************************** + ! *** Collect forecast ensemble on filter PEs *** + ! *********************************************** + + doevolB: IF (nsteps > 0) THEN + + IF (.not.filterpe) THEN + ! Non filter PEs only store a sub-ensemble + CALL PDAF_gather_ens(dim_p, dim_ens_l, eofV, screen) + ELSE + ! On filter PEs, the ensemble array has full size + CALL PDAF_gather_ens(dim_p, dim_ens, eofV, screen) + END IF + + END IF doevolB + + ! *** call timer + CALL PDAF_timeit(2, 'old') + + IF (.NOT.offline_mode .AND. mype_world == 0 .AND. screen > 1) THEN + WRITE (*, '(a, 5x, a, F10.3, 1x, a)') & + 'PDAF', '--- duration of forecast phase:', PDAF_time_temp(2), 's' + END IF + + + ! ************************************** + ! *** Perform analysis on filter PEs *** + ! ************************************** + + ! Screen output + IF (offline_mode .AND. mype_world == 0 .AND. screen > 0) THEN + WRITE (*, '(//a5, 64a)') 'PDAF ',('-', i = 1, 64) + WRITE (*, '(a, 20x, a)') 'PDAF', '+++++ ASSIMILATION +++++' + WRITE (*, '(a5, 64a)') 'PDAF ', ('-', i = 1, 64) + ENDIF + + OnFilterPE: IF (filterpe) THEN + IF (subtype_filter == 4) THEN + CALL PDAF_lknetf_update(step_obs, dim_p, dim_obs, dim_ens, state, & + eofU, eofV, state_inc, U_init_dim_obs, & + U_obs_op, U_init_obs, U_init_obs_l, U_prodRinvA_l, U_init_n_domains_p, & + U_init_dim_l, U_init_dim_obs_l, PDAFlocal_g2l_cb, & + PDAFlocal_l2g_cb, U_g2l_obs, & + U_init_obsvar, U_init_obsvar_l, U_likelihood_l, & + U_prepoststep, screen, subtype_filter, incremental, type_forget, & + dim_lag, sens, cnt_maxlag, flag) + ELSE + CALL PDAF_lknetf_step_update(step_obs, dim_p, dim_obs, dim_ens, state, & + eofU, eofV, state_inc, U_init_dim_obs, & + U_obs_op, U_init_obs, U_init_obs_l, U_prodRinvA_hyb_l, U_init_n_domains_p, & + U_init_dim_l, U_init_dim_obs_l, PDAFlocal_g2l_cb, & + PDAFlocal_l2g_cb, U_g2l_obs, & + U_init_obsvar, U_init_obsvar_l, U_likelihood_l, U_likelihood_hyb_l, U_prepoststep, & + screen, subtype_filter, & + incremental, type_forget, dim_lag, sens, cnt_maxlag, flag) + END IF + END IF OnFilterPE + + + ! *********************************** + ! *** Set forecast counters/flags *** + ! *********************************** + initevol = 1 + member = 1 + step = step_obs + 1 + + END IF completeforecast + + +! ******************** +! *** finishing up *** +! ******************** + + outflag = flag + +END SUBROUTINE PDAFlocal_put_state_lknetf diff --git a/src/PDAFlocal_put_state_lknetf_si.F90 b/src/PDAFlocal_put_state_lknetf_si.F90 new file mode 100644 index 000000000..1b3756678 --- /dev/null +++ b/src/PDAFlocal_put_state_lknetf_si.F90 @@ -0,0 +1,86 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocal_put_state_lknetf_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocal_put_state_lknetf_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model after the +! forecast of each ensemble state to transfer data +! from the model to PDAF. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! Variant for LKNETF with domain decomposition. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2018-07 - Lars Nerger - Initial code based on LETKF +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + obs_op_f_pdaf, & ! Full observation operator + init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector + init_dim_obs_l_pdaf, & ! Initialize local dimimension of obs. vector + init_obs_f_pdaf, & ! Initialize full observation vector + init_obs_l_pdaf, & ! Initialize local observation vector + init_obsvar_pdaf, & ! Initialize mean observation error variance + init_obsvar_l_pdaf, & ! Initialize local mean observation error variance + g2l_obs_pdaf, & ! Restrict full obs. vector to local analysis domain + prodRinvA_l_pdaf, & ! Provide product R^-1 A on local analysis domain + prodRinvA_hyb_l_pdaf, & ! Provide product R^-1 A on local analysis domain with hybrid weight + likelihood_l_pdaf, & ! Compute observation likelihood for an ensemble member + likelihood_hyb_l_pdaf, & ! Compute observation likelihood for an ensemble member with hybrid weight + prepoststep_pdaf ! User supplied pre/poststep routine + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFlocal_put_state_lknetf +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFlocal_put_state_lknetf(collect_state_pdaf, init_dim_obs_f_pdaf, & + obs_op_f_pdaf, init_obs_f_pdaf, init_obs_l_pdaf, prepoststep_pdaf, & + prodRinvA_l_pdaf, prodRinvA_hyb_l_pdaf, init_n_domains_pdaf, init_dim_l_pdaf, & + init_dim_obs_l_pdaf, g2l_obs_pdaf, init_obsvar_pdaf, init_obsvar_l_pdaf, likelihood_l_pdaf, & + likelihood_hyb_l_pdaf, outflag) + +END SUBROUTINE PDAFlocal_put_state_lknetf_si diff --git a/src/PDAFlocal_put_state_lnetf.F90 b/src/PDAFlocal_put_state_lnetf.F90 new file mode 100644 index 000000000..a8bee8cf8 --- /dev/null +++ b/src/PDAFlocal_put_state_lnetf.F90 @@ -0,0 +1,204 @@ +! Copyright (c) 2014-2024 Paul Kirchgessner +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocal_put_state_lnetf --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocal_put_state_lnetf(U_collect_state, U_init_dim_obs, U_obs_op, & + U_init_obs_l, U_prepoststep, U_likelihood_l, U_init_n_domains_p, & + U_init_dim_l, U_init_dim_obs_l, U_g2l_obs, & + outflag) + +! !DESCRIPTION: +! Interface routine called from the model after the +! forecast of each ensemble state to transfer data +! from the model to PDAF. For the parallelization +! this involves transfer from model PEs to filter +! PEs.\\ +! During the forecast phase state vectors are +! re-initialized from the forecast model fields +! by U\_collect\_state. +! At the end of a forecast phase (i.e. when all +! ensemble members have been integrated by the model) +! sub-ensembles are gathered from the model tasks. +! Subsequently the filter update is performed. +! +! The code is very generic. Basically the only +! filter-specific part if the call to the +! update-routine PDAF\_X\_update where the analysis +! is computed. The filter-specific subroutines that +! are specified in the call to PDAF\_put\_state\_X +! are passed through to the update routine +! +! Variant for LNETF with domain decomposition. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2014-05 - Paul Kirchgessner - Initial code based on LETKF +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + USE PDAF_communicate_ens, & + ONLY: PDAF_gather_ens + USE PDAF_timer, & + ONLY: PDAF_timeit, PDAF_time_temp + USE PDAF_memcounting, & + ONLY: PDAF_memcount + USE PDAF_mod_filter, & + ONLY: dim_p, dim_obs, dim_ens, local_dim_ens, & + nsteps, step_obs, step, member, member_save, subtype_filter, & + type_forget, initevol, state, eofV, & + noise_type, pf_noise_amp, offline_mode, & + eofU, screen, flag, sens, dim_lag, cnt_maxlag + USE PDAF_mod_filtermpi, & + ONLY: mype_world, filterpe, dim_ens_l + USE PDAFlocal, & + ONLY: PDAFlocal_g2l_cb, & ! Project global to local state vector + PDAFlocal_l2g_cb ! Project local to global state vecto + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(out) :: outflag ! Status flag + +! ! External subroutines +! ! (PDAF-internal names, real names are defined in the call to PDAF) + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_init_obs_l, & ! Init. observation vector on local analysis domain + U_g2l_obs, & ! Restrict full obs. vector to local analysis domain + U_likelihood_l, & ! Compute observation likelihood for an ensemble member + U_prepoststep ! User supplied pre/poststep routine + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: U_collect_state +! Calls: PDAF_gather_ens +! Calls: PDAF_etkf_update +! Calls: PDAF_timeit +!EOP + +! local variables + INTEGER :: i ! Counter + + +! ************************************************** +! *** Save forecasted state back to the ensemble *** +! *** Only done on the filter Pes *** +! ************************************************** + + doevol: IF (nsteps > 0 ) THEN + + CALL PDAF_timeit(41, 'new') + + ! Store member index for PDAF_get_memberid + member_save = member + + ! Save evolved state in ensemble matrix + CALL U_collect_state(dim_p, eofV(1 : dim_p, member)) + + CALL PDAF_timeit(41, 'old') + + member = member + 1 + ELSE + member = local_dim_ens + 1 + END IF doevol + + +! ******************************************************** +! *** When forecast phase is completed *** +! *** - collect forecast sub_ensembles on filter PEs *** +! *** - perform analysis step *** +! *** - re-initialize forecast counters/flags *** +! ******************************************************** + completeforecast: IF (member == local_dim_ens + 1 & + .OR. offline_mode) THEN + + ! *********************************************** + ! *** Collect forecast ensemble on filter PEs *** + ! *********************************************** + + doevolB: IF (nsteps > 0) THEN + + IF (.not.filterpe) THEN + ! Non filter PEs only store a sub-ensemble + CALL PDAF_gather_ens(dim_p, dim_ens_l, eofV, screen) + ELSE + ! On filter PEs, the ensemble array has full size + CALL PDAF_gather_ens(dim_p, dim_ens, eofV, screen) + END IF + + END IF doevolB + + ! *** call timer + CALL PDAF_timeit(2, 'old') + + IF (.NOT.offline_mode .AND. mype_world == 0 .AND. screen > 1) THEN + WRITE (*, '(a, 5x, a, F10.3, 1x, a)') & + 'PDAF', '--- duration of forecast phase:', PDAF_time_temp(2), 's' + END IF + + + ! ************************************** + ! *** Perform analysis on filter PEs *** + ! ************************************** + + ! Screen output + IF (offline_mode .AND. mype_world == 0 .AND. screen > 0) THEN + WRITE (*, '(//a5, 64a)') 'PDAF ',('-', i = 1, 64) + WRITE (*, '(a, 20x, a)') 'PDAF', '+++++ ASSIMILATION +++++' + WRITE (*, '(a5, 64a)') 'PDAF ', ('-', i = 1, 64) + ENDIF + + OnFilterPE: IF (filterpe) THEN + + CALL PDAF_lnetf_update(step_obs, dim_p, dim_obs, dim_ens, & + state, eofU, eofV, type_forget, noise_type, pf_noise_amp, & + U_obs_op, U_init_dim_obs, U_init_obs_l, U_likelihood_l, & + U_init_n_domains_p, U_init_dim_l, U_init_dim_obs_l, PDAFlocal_g2l_cb, & + PDAFlocal_l2g_cb, U_g2l_obs, U_prepoststep, screen, subtype_filter, & + dim_lag, sens, cnt_maxlag, flag) + + END IF OnFilterPE + + + ! *********************************** + ! *** Set forecast counters/flags *** + ! *********************************** + initevol = 1 + member = 1 + step = step_obs + 1 + + END IF completeforecast + + +! ******************** +! *** finishing up *** +! ******************** + + outflag = flag + +END SUBROUTINE PDAFlocal_put_state_lnetf diff --git a/src/PDAFlocal_put_state_lnetf_si.F90 b/src/PDAFlocal_put_state_lnetf_si.F90 new file mode 100644 index 000000000..1d0a90ae5 --- /dev/null +++ b/src/PDAFlocal_put_state_lnetf_si.F90 @@ -0,0 +1,78 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocal_put_state_lnetf_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocal_put_state_lnetf_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model after the +! forecast of each ensemble state to transfer data +! from the model to PDAF. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! Variant for LNETF with domain decomposition. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2016-11 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + obs_op_f_pdaf, & ! Full observation operator + init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector + init_dim_obs_l_pdaf, & ! Initialize local dimimension of obs. vector + init_obs_l_pdaf, & ! Initialize local observation vector + g2l_obs_pdaf, & ! Restrict full obs. vector to local analysis domain + likelihood_l_pdaf, & ! Compute observation likelihood for an ensemble member + prepoststep_pdaf ! User supplied pre/poststep routine + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFlocal_put_state_lnetf +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFlocal_put_state_lnetf(collect_state_pdaf, init_dim_obs_f_pdaf, obs_op_f_pdaf, & + init_obs_l_pdaf, prepoststep_pdaf, likelihood_l_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdaf, g2l_obs_pdaf, outflag) + +END SUBROUTINE PDAFlocal_put_state_lnetf_si diff --git a/src/PDAFlocal_put_state_lseik.F90 b/src/PDAFlocal_put_state_lseik.F90 new file mode 100644 index 000000000..cea6aac1b --- /dev/null +++ b/src/PDAFlocal_put_state_lseik.F90 @@ -0,0 +1,214 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! The code is very generic. Basically the only +! filter-specific part if the call to the +! update-routine PDAF\_X\_update where the analysis +! is computed. The filter-specific subroutines that +! are specified in the call to PDAF\_put\_state\_X +! are passed through to the update routine +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocal_put_state_lseik --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocal_put_state_lseik(U_collect_state, U_init_dim_obs, U_obs_op, & + U_init_obs, U_init_obs_l, U_prepoststep, U_prodRinvA_l, U_init_n_domains_p, & + U_init_dim_l, U_init_dim_obs_l, U_g2l_obs, & + U_init_obsvar, U_init_obsvar_l, outflag) + +! !DESCRIPTION: +! Interface routine called from the model after the +! forecast of each ensemble state to transfer data +! from the model to PDAF. For the parallelization +! this involves transfer from model PEs to filter +! PEs.\\ +! During the forecast phase state vectors are +! re-initialized from the forecast model fields +! by U\_collect\_state. +! At the end of a forecast phase (i.e. when all +! ensemble members have been integrated by the model) +! sub-ensembles are gathered from the model tasks. +! Subsequently the filter update is performed. +! +! Variant for LSEIK with domain decomposition. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2003-09 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + USE PDAF_communicate_ens, & + ONLY: PDAF_gather_ens + USE PDAF_timer, & + ONLY: PDAF_timeit, PDAF_time_temp + USE PDAF_mod_filter, & + ONLY: dim_p, dim_obs, dim_ens, rank, local_dim_ens, & + nsteps, step_obs, step, member, member_save, subtype_filter, & + type_forget, incremental, initevol, state, eofV, eofU, & + state_inc, screen, flag, type_sqrt, offline_mode + USE PDAF_mod_filtermpi, & + ONLY: mype_world, filterpe, dim_ens_l, modelpe, filter_no_model + USE PDAFlocal, & + ONLY: PDAFlocal_g2l_cb, & ! Project global to local state vector + PDAFlocal_l2g_cb ! Project local to global state vecto + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(out) :: outflag ! Status flag + +! ! External subroutines +! ! (PDAF-internal names, real names are defined in the call to PDAF) + EXTERNAL :: U_collect_state, & ! Routine to collect a state vector + U_obs_op, & ! Observation operator + U_init_n_domains_p, & ! Provide number of local analysis domains + U_init_dim_l, & ! Init state dimension for local ana. domain + U_init_dim_obs, & ! Initialize dimension of observation vector + U_init_dim_obs_l, & ! Initialize dim. of obs. vector for local ana. domain + U_init_obs, & ! Initialize PE-local observation vector + U_init_obs_l, & ! Init. observation vector on local analysis domain + U_init_obsvar, & ! Initialize mean observation error variance + U_init_obsvar_l, & ! Initialize local mean observation error variance + U_g2l_obs, & ! Restrict full obs. vector to local analysis domain + U_prodRinvA_l, & ! Provide product R^-1 A on local analysis domain + U_prepoststep ! User supplied pre/poststep routine + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: U_collect_state +! Calls: PDAF_gather_ens +! Calls: PDAF_lseik_update +! Calls: PDAF_timeit +!EOP + +! local variables + INTEGER :: i ! Counter + + +! ************************************************** +! *** Save forecast state back to the ensemble *** +! *** Only done on the filter Pes *** +! ************************************************** + + doevol: IF (nsteps > 0) THEN + + CALL PDAF_timeit(41, 'new') + + modelpes: IF (modelpe) THEN + + ! Store member index for PDAF_get_memberid + member_save = member + + IF (subtype_filter /= 2 .AND. subtype_filter /= 3) THEN + ! Save evolved state in ensemble matrix + CALL U_collect_state(dim_p, eofV(1 : dim_p, member)) + ELSE + ! Save evolved ensemble mean state + CALL U_collect_state(dim_p, state(1 : dim_p)) + END IF + END IF modelpes + + CALL PDAF_timeit(41, 'old') + + member = member + 1 + ELSE + member = local_dim_ens + 1 + END IF doevol + + IF (filter_no_model .AND. filterpe) THEN + member = local_dim_ens + 1 + END IF + + +! ******************************************************** +! *** When forecast phase is completed *** +! *** - collect forecast sub_ensembles on filter PEs *** +! *** - perform analysis step *** +! *** - re-initialize forecast counters/flags *** +! ******************************************************** + completeforecast: IF (member == local_dim_ens + 1 & + .OR. offline_mode) THEN + + ! *********************************************** + ! *** Collect forecast ensemble on filter PEs *** + ! *********************************************** + + doevolB: IF (nsteps > 0) THEN + + IF (.NOT.filterpe) THEN + ! Non filter PEs only store a sub-ensemble + CALL PDAF_gather_ens(dim_p, dim_ens_l, eofV, screen) + ELSE + ! On filter PEs, the ensemble array has full size + CALL PDAF_gather_ens(dim_p, dim_ens, eofV, screen) + END IF + + END IF doevolB + + ! *** call timer + CALL PDAF_timeit(2, 'old') + + IF (.NOT.offline_mode .AND. mype_world == 0 .AND. screen > 1) THEN + WRITE (*, '(a, 5x, a, F10.3, 1x, a)') & + 'PDAF', '--- duration of forecast phase:', PDAF_time_temp(2), 's' + END IF + + + ! ************************************** + ! *** Perform analysis on filter PEs *** + ! ************************************** + + ! Screen output + IF (offline_mode .AND. mype_world == 0 .AND. screen > 0) THEN + WRITE (*, '(//a5, 64a)') 'PDAF ',('-', i = 1, 64) + WRITE (*, '(a, 20x, a)') 'PDAF', '+++++ ASSIMILATION +++++' + WRITE (*, '(a5, 64a)') 'PDAF ', ('-', i = 1, 64) + ENDIF + + OnFilterPE: IF (filterpe) THEN + CALL PDAF_lseik_update(step_obs, dim_p, dim_obs, dim_ens, rank, state, & + eofU, eofV, state_inc, U_init_dim_obs, & + U_obs_op, U_init_obs, U_init_obs_l, U_prodRinvA_l, U_init_n_domains_p, & + U_init_dim_l, U_init_dim_obs_l, PDAFlocal_g2l_cb, PDAFlocal_l2g_cb, U_g2l_obs, & + U_init_obsvar, U_init_obsvar_l, U_prepoststep, screen, subtype_filter, & + incremental, type_forget, type_sqrt, flag) + END IF OnFilterPE + + + ! *********************************** + ! *** Set forecast counters/flags *** + ! *********************************** + initevol = 1 + member = 1 + step = step_obs + 1 + + END IF completeforecast + + +! ******************** +! *** finishing up *** +! ******************** + + outflag = flag + +END SUBROUTINE PDAFlocal_put_state_lseik diff --git a/src/PDAFlocal_put_state_lseik_si.F90 b/src/PDAFlocal_put_state_lseik_si.F90 new file mode 100644 index 000000000..5256d756b --- /dev/null +++ b/src/PDAFlocal_put_state_lseik_si.F90 @@ -0,0 +1,82 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocal_put_state_lseik_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocal_put_state_lseik_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model after the +! forecast of each ensemble state to transfer data +! from the model to PDAF. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! Variant for LSEIK with domain decomposition. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2010-07 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + obs_op_f_pdaf, & ! Full observation operator + init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector + init_dim_obs_l_pdaf, & ! Initialize local dimimension of obs. vector + init_obs_f_pdaf, & ! Initialize full observation vector + init_obs_l_pdaf, & ! Initialize local observation vector + init_obsvar_pdaf, & ! Initialize mean observation error variance + init_obsvar_l_pdaf, & ! Initialize local mean observation error variance + g2l_obs_pdaf, & ! Restrict full obs. vector to local analysis domain + prodRinvA_l_pdaf, & ! Provide product R^-1 A on local analysis domain + prepoststep_pdaf ! User supplied pre/poststep routine + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFlocal_put_state_lseik +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFlocal_put_state_lseik(collect_state_pdaf, init_dim_obs_f_pdaf, & + obs_op_f_pdaf, init_obs_f_pdaf, init_obs_l_pdaf, prepoststep_pdaf, & + prodRinvA_l_pdaf, init_n_domains_pdaf, init_dim_l_pdaf, & + init_dim_obs_l_pdaf, g2l_obs_pdaf, init_obsvar_pdaf, init_obsvar_l_pdaf, outflag) + +END SUBROUTINE PDAFlocal_put_state_lseik_si diff --git a/src/PDAFlocal_set_increment_weights.F90 b/src/PDAFlocal_set_increment_weights.F90 new file mode 100644 index 000000000..2507c8b7f --- /dev/null +++ b/src/PDAFlocal_set_increment_weights.F90 @@ -0,0 +1,59 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! + +!> Set vector of local increment weights +!! +!! This routine initializes a PDAF_internal local array +!! of increment weights. The weights are applied in +!! in PDAF_local_l2g_cb, when the global state vector +!! is initialized from the local state vector. These can +!! e.g. be used to apply a vertical localization. +!! +!! __Revision history:__ +!! * 2024-08 - Lars Nerger - Initial code +!! * Later revisions - see repository log +!! +SUBROUTINE PDAFlocal_set_increment_weights(dim_l, weights) + + USE PDAF_mod_filter, & + ONLY: debug + USE PDAFlocal, & + ONLY: l2g_weights + + IMPLICIT NONE + +! *** Arguments *** + INTEGER, INTENT(in) :: dim_l !< Dimension of local state vector + REAL, INTENT(in) :: weights(dim_l) !< Weights array + + +! ******************************************** +! *** Initialize PDAF_internal index array *** +! ******************************************** + + IF (ALLOCATED(l2g_weights)) DEALLOCATE(l2g_weights) + ALLOCATE(l2g_weights(dim_l)) + + l2g_weights(:) = weights(:) + + IF (debug>0) THEN + WRITE (*,*) '++ PDAF-debug: ', debug, 'PDAFlocal_set_increment_weights -- Set local increment weights' + WRITE (*,*) '++ PDAF-debug PDAFlocal_set_increment_weights:', debug, 'weights', l2g_weights(1:dim_l) + END IF + +END SUBROUTINE PDAFlocal_set_increment_weights diff --git a/src/PDAFlocal_set_indices.F90 b/src/PDAFlocal_set_indices.F90 new file mode 100644 index 000000000..c3899c8b6 --- /dev/null +++ b/src/PDAFlocal_set_indices.F90 @@ -0,0 +1,55 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! + +!> Set index vector to map between global and local state vectors +!! +!! This routine initializes a PDAF_internal local index array +!! for the mapping between the global and local state vectors +!! +!! __Revision history:__ +!! * 2024-08 - Lars Nerger - Initial code +!! * Later revisions - see repository log +!! +SUBROUTINE PDAFlocal_set_indices(dim_l, map) + + USE PDAF_mod_filter, & + ONLY: debug + USE PDAFlocal, & + ONLY: id_lstate_in_pstate + + IMPLICIT NONE + +! *** Arguments *** + INTEGER, INTENT(in) :: dim_l !< Dimension of local state vector + INTEGER, INTENT(in) :: map(dim_l) !< Index array for mapping + + +! ******************************************** +! *** Initialize PDAF_internal index array *** +! ******************************************** + + IF (ALLOCATED(id_lstate_in_pstate)) DEALLOCATE(id_lstate_in_pstate) + ALLOCATE(id_lstate_in_pstate(dim_l)) + + id_lstate_in_pstate(:) = map(:) + + IF (debug>0) THEN + WRITE (*,*) '++ PDAF-debug PDAFlocal_set_indices:', debug, 'indices', id_lstate_in_pstate(1:dim_l) + END IF + +END SUBROUTINE PDAFlocal_set_indices diff --git a/src/PDAFlocalomi_assimilate.F90 b/src/PDAFlocalomi_assimilate.F90 new file mode 100644 index 000000000..8d4949c2a --- /dev/null +++ b/src/PDAFlocalomi_assimilate.F90 @@ -0,0 +1,139 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocalomi_assimilate --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocalomi_assimilate(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, prepoststep_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdaf, & + next_observation_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all domain-localized filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2020-11 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector + obs_op_f_pdaf, & ! Full observation operator + init_dim_obs_l_pdaf ! Initialize local dimimension of obs. vector + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize full observation vector + PDAFomi_init_obs_l_cb, & ! Initialize local observation vector + PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance + PDAFomi_init_obsvar_l_cb, & ! Initialize local mean observation error variance + PDAFomi_g2l_obs_cb, & ! Restrict full obs. vector to local analysis domain + PDAFomi_prodRinvA_l_cb, & ! Provide product R^-1 A on local analysis domain + PDAFomi_likelihood_l_cb ! Compute likelihood and apply localization + EXTERNAL :: PDAFomi_prodRinvA_hyb_l_cb, & ! Product R^-1 A on local analysis domain with hybrid weight + PDAFomi_likelihood_hyb_l_cb ! Compute likelihood and apply localization with tempering + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFlocalomi_assimilate -- START' + + IF (TRIM(filterstr) == 'LSEIK') THEN + CALL PDAFlocal_assimilate_lseik(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, & + prepoststep_pdaf, PDAFomi_prodRinvA_l_cb, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdaf, & + PDAFomi_g2l_obs_cb, PDAFomi_init_obsvar_cb, PDAFomi_init_obsvar_l_cb, & + next_observation_pdaf, outflag) + ELSE IF (TRIM(filterstr) == 'LETKF') THEN + CALL PDAFlocal_assimilate_letkf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, & + prepoststep_pdaf, PDAFomi_prodRinvA_l_cb, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdaf, & + PDAFomi_g2l_obs_cb, PDAFomi_init_obsvar_cb, PDAFomi_init_obsvar_l_cb, & + next_observation_pdaf, outflag) + ELSE IF (TRIM(filterstr) == 'LESTKF') THEN + CALL PDAFlocal_assimilate_lestkf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, & + prepoststep_pdaf, PDAFomi_prodRinvA_l_cb, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdaf, & + PDAFomi_g2l_obs_cb, PDAFomi_init_obsvar_cb, PDAFomi_init_obsvar_l_cb, & + next_observation_pdaf, outflag) + ELSE IF (TRIM(filterstr) == 'LNETF') THEN + CALL PDAFlocal_assimilate_lnetf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, PDAFomi_init_obs_l_cb, & + prepoststep_pdaf, PDAFomi_likelihood_l_cb, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdaf, & + PDAFomi_g2l_obs_cb, next_observation_pdaf, outflag) + ELSE IF (TRIM(filterstr) == 'LKNETF') THEN + CALL PDAFlocal_assimilate_lknetf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, & + PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, prepoststep_pdaf, & + PDAFomi_prodRinvA_l_cb, PDAFomi_prodRinvA_hyb_l_cb, & + init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdaf, & + PDAFomi_g2l_obs_cb, PDAFomi_init_obsvar_cb, & + PDAFomi_init_obsvar_l_cb, PDAFomi_likelihood_l_cb, PDAFomi_likelihood_hyb_l_cb, & + next_observation_pdaf, outflag) + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFlocalomi_assimilate -- END' + +END SUBROUTINE PDAFlocalomi_assimilate diff --git a/src/PDAFlocalomi_assimilate_en3dvar_lestkf.F90 b/src/PDAFlocalomi_assimilate_en3dvar_lestkf.F90 new file mode 100644 index 000000000..68226c06a --- /dev/null +++ b/src/PDAFlocalomi_assimilate_en3dvar_lestkf.F90 @@ -0,0 +1,118 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocalomi_assimilate_en3dvar_lestkf --- Interface to PDAF for En3D-Var/LESTKF +! +! !INTERFACE: +SUBROUTINE PDAFlocalomi_assimilate_en3dvar_lestkf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & + init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdaf, & + prepoststep_pdaf, next_observation_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2021-04 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix + obs_op_lin_pdaf, & ! Linearized observation operator + obs_op_adj_pdaf ! Adjoint observation operator + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector + obs_op_f_pdaf, & ! Full observation operator + init_dim_obs_l_pdaf ! Initialize local dimimension of obs. vector + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector + PDAFomi_init_obs_l_cb, & ! Initialize local observation vector + PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance + PDAFomi_init_obsvar_l_cb, & ! Initialize local mean observation error variance + PDAFomi_prodRinvA_cb, & ! Provide product R^-1 A + PDAFomi_g2l_obs_cb, & ! Restrict full obs. vector to local analysis domain + PDAFomi_prodRinvA_l_cb, & ! Provide product R^-1 A on local analysis domain + PDAFomi_likelihood_l_cb ! Compute likelihood and apply localization + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFlocalomi_assimilate_en3dvar_lestkf -- START' + + IF (TRIM(filterstr) == '3DVAR') THEN + CALL PDAFlocal_assimilate_en3dvar_lestkf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, PDAFomi_init_obs_f_cb, PDAFomi_prodRinvA_cb, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, & + PDAFomi_prodRinvA_l_cb, init_n_domains_pdaf, init_dim_l_pdaf, & + init_dim_obs_l_pdaf, PDAFomi_g2l_obs_cb, & + PDAFomi_init_obsvar_cb, PDAFomi_init_obsvar_l_cb, & + prepoststep_pdaf, next_observation_pdaf, outflag) + ELSE + WRITE (*,*) 'PDAF-ERROR: No valid filter type for PDAFlocalomi_assimilate_3dvar' + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFlocalomi_assimilate_en3dvar_lestkf -- END' + +END SUBROUTINE PDAFlocalomi_assimilate_en3dvar_lestkf diff --git a/src/PDAFlocalomi_assimilate_en3dvar_lestkf_nondiagR.F90 b/src/PDAFlocalomi_assimilate_en3dvar_lestkf_nondiagR.F90 new file mode 100644 index 000000000..0185fa586 --- /dev/null +++ b/src/PDAFlocalomi_assimilate_en3dvar_lestkf_nondiagR.F90 @@ -0,0 +1,118 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocalomi_assimilate_en3dvar_lestkf_nondiagR --- Interface to PDAF for En3D-Var/LESTKF +! +! !INTERFACE: +SUBROUTINE PDAFlocalomi_assimilate_en3dvar_lestkf_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prodRinvA_pdafomi, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdafomi, obs_op_adj_pdafomi, & + prodRinvA_l_pdafomi, init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdafomi, & + prepoststep_pdaf, next_observation_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf ! Apply adjoint control vector transform matrix + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf ! Init state dimension for local ana. domain + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of full observation vector + obs_op_pdafomi, & ! Full observation operator + obs_op_lin_pdafomi, & ! Linearized observation operator + obs_op_adj_pdafomi, & ! Adjoint observation operator + init_dim_obs_l_pdafomi, & ! Initialize local dimimension of obs. vector + prodRinvA_pdafomi, & ! Provide product R^-1 A + prodRinvA_l_pdafomi ! Provide product R^-1 A with localization + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector + PDAFomi_init_obs_l_cb, & ! Initialize local observation vector + PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance + PDAFomi_init_obsvar_l_cb, & ! Initialize local mean observation error variance + PDAFomi_g2l_obs_cb ! Restrict full obs. vector to local analysis domain + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFlocalomi_assimilate_en3dvar_lestkf_nondiagR -- START' + + IF (TRIM(filterstr) == '3DVAR') THEN + CALL PDAFlocal_assimilate_en3dvar_lestkf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, prodRinvA_pdafomi, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdafomi, obs_op_adj_pdafomi, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, & + prodRinvA_l_pdafomi, init_n_domains_pdaf, init_dim_l_pdaf, & + init_dim_obs_l_pdafomi, PDAFomi_g2l_obs_cb, & + PDAFomi_init_obsvar_cb, PDAFomi_init_obsvar_l_cb, & + prepoststep_pdaf, next_observation_pdaf, outflag) + ELSE + WRITE (*,*) 'PDAF-ERROR: No valid filter type for PDAFlocalomi_assimilate_en3dvar_lestkf_nondiagR' + outflag = 200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFlocalomi_assimilate_en3dvar_lestkf_nondiagR -- END' + +END SUBROUTINE PDAFlocalomi_assimilate_en3dvar_lestkf_nondiagR diff --git a/src/PDAFlocalomi_assimilate_hyb3dvar_lestkf.F90 b/src/PDAFlocalomi_assimilate_hyb3dvar_lestkf.F90 new file mode 100644 index 000000000..64b3305ce --- /dev/null +++ b/src/PDAFlocalomi_assimilate_hyb3dvar_lestkf.F90 @@ -0,0 +1,121 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocalomi_assimilate_hyb3dvar_lestkf --- Interface to PDAF for Hyb3D-Var/LESTKF +! +! !INTERFACE: +SUBROUTINE PDAFlocalomi_assimilate_hyb3dvar_lestkf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, cvt_pdaf, cvt_adj_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & + init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdaf, & + prepoststep_pdaf, next_observation_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2021-04 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix + cvt_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_pdaf, & ! Apply adjoint control vector transform matrix + obs_op_lin_pdaf, & ! Linearized observation operator + obs_op_adj_pdaf ! Adjoint observation operator + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector + obs_op_f_pdaf, & ! Full observation operator + init_dim_obs_l_pdaf ! Initialize local dimimension of obs. vector + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector + PDAFomi_init_obs_l_cb, & ! Initialize local observation vector + PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance + PDAFomi_init_obsvar_l_cb, & ! Initialize local mean observation error variance + PDAFomi_prodRinvA_cb, & ! Provide product R^-1 A + PDAFomi_g2l_obs_cb, & ! Restrict full obs. vector to local analysis domain + PDAFomi_prodRinvA_l_cb, & ! Provide product R^-1 A on local analysis domain + PDAFomi_likelihood_l_cb ! Compute likelihood and apply localization + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFlocalomi_assimilate_hyb3dvar_lestkf -- START' + + IF (TRIM(filterstr) == '3DVAR') THEN + CALL PDAFlocal_assimilate_hyb3dvar_lestkf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, PDAFomi_init_obs_f_cb, & + PDAFomi_prodRinvA_cb, cvt_ens_pdaf, cvt_adj_ens_pdaf, cvt_pdaf, cvt_adj_pdaf, & + obs_op_lin_pdaf, obs_op_adj_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, & + PDAFomi_prodRinvA_l_cb, init_n_domains_pdaf, init_dim_l_pdaf, & + init_dim_obs_l_pdaf, PDAFomi_g2l_obs_cb, & + PDAFomi_init_obsvar_cb, PDAFomi_init_obsvar_l_cb, & + prepoststep_pdaf, next_observation_pdaf, outflag) + ELSE + WRITE (*,*) 'PDAF-ERROR: No valid filter type for PDAFlocalomi_assimilate_3dvar' + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFlocalomi_assimilate_hyb3dvar_lestkf -- END' + +END SUBROUTINE PDAFlocalomi_assimilate_hyb3dvar_lestkf diff --git a/src/PDAFlocalomi_assimilate_hyb3dvar_lestkf_nondiagR.F90 b/src/PDAFlocalomi_assimilate_hyb3dvar_lestkf_nondiagR.F90 new file mode 100644 index 000000000..0928b74e0 --- /dev/null +++ b/src/PDAFlocalomi_assimilate_hyb3dvar_lestkf_nondiagR.F90 @@ -0,0 +1,122 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocalomi_assimilate_hyb3dvar_lestkf_nondiagR --- Interface to PDAF for Hyb3D-Var/LESTKF +! +! !INTERFACE: +SUBROUTINE PDAFlocalomi_assimilate_hyb3dvar_lestkf_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prodRinvA_pdafomi, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, cvt_pdaf, cvt_adj_pdaf, obs_op_lin_pdafomi, obs_op_adj_pdafomi, & + prodRinvA_l_pdafomi, init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdafomi, & + prepoststep_pdaf, next_observation_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix + cvt_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_pdaf ! Apply adjoint control vector transform matrix + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf ! Init state dimension for local ana. domain + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of full observation vector + obs_op_pdafomi, & ! Full observation operator + obs_op_lin_pdafomi, & ! Linearized observation operator + obs_op_adj_pdafomi, & ! Adjoint observation operator + init_dim_obs_l_pdafomi, & ! Initialize local dimimension of obs. vector + prodRinvA_pdafomi, & ! Provide product R^-1 A + prodRinvA_l_pdafomi ! Provide product R^-1 A + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector + PDAFomi_init_obs_l_cb, & ! Initialize local observation vector + PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance + PDAFomi_init_obsvar_l_cb, & ! Initialize local mean observation error variance + PDAFomi_prodRinvA_cb, & ! Provide product R^-1 A + PDAFomi_g2l_obs_cb ! Restrict full obs. vector to local analysis domain + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFlocalomi_assimilate_hyb3dvar_lestkf_nondiagR -- START' + + IF (TRIM(filterstr) == '3DVAR') THEN + CALL PDAFlocal_assimilate_hyb3dvar_lestkf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, & + prodRinvA_pdafomi, cvt_ens_pdaf, cvt_adj_ens_pdaf, cvt_pdaf, cvt_adj_pdaf, & + obs_op_lin_pdafomi, obs_op_adj_pdafomi, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, & + prodRinvA_l_pdafomi, init_n_domains_pdaf, init_dim_l_pdaf, & + init_dim_obs_l_pdafomi, PDAFomi_g2l_obs_cb, & + PDAFomi_init_obsvar_cb, PDAFomi_init_obsvar_l_cb, & + prepoststep_pdaf, next_observation_pdaf, outflag) + ELSE + WRITE (*,*) 'PDAF-ERROR: No valid filter type for PDAFlocalomi_assimilate_hyb3dvar_lestkf_nondiagR' + outflag = 200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFlocalomi_assimilate_hyb3dvar_lestkf_nondiagR -- END' + +END SUBROUTINE PDAFlocalomi_assimilate_hyb3dvar_lestkf_nondiagR diff --git a/src/PDAFlocalomi_assimilate_lknetf_nondiagR.F90 b/src/PDAFlocalomi_assimilate_lknetf_nondiagR.F90 new file mode 100644 index 000000000..a96fd25ee --- /dev/null +++ b/src/PDAFlocalomi_assimilate_lknetf_nondiagR.F90 @@ -0,0 +1,116 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocalomi_assimilate_lknetf_nondiagR --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocalomi_assimilate_lknetf_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, prodRinvA_l_pdafomi, prodRinvA_hyb_l_pdafomi, & + likelihood_l_pdafomi, likelihood_hyb_l_pdafomi, & + next_observation_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all domain-localized filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf ! Init state dimension for local ana. domain + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of full observation vector + obs_op_pdafomi, & ! Full observation operator + init_dim_obs_l_pdafomi, & ! Initialize local dimimension of obs. vector + prodRinvA_l_pdafomi, & ! Provide product R^-1 A on local analysis domain + likelihood_l_pdafomi, & ! Compute likelihood and apply localization + prodRinvA_hyb_l_pdafomi, & ! Product R^-1 A on local analysis domain with hybrid weight + likelihood_hyb_l_pdafomi ! Compute likelihood and apply localization with tempering + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize full observation vector + PDAFomi_init_obs_l_cb, & ! Initialize local observation vector + PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance + PDAFomi_init_obsvar_l_cb, & ! Initialize local mean observation error variance + PDAFomi_g2l_obs_cb ! Restrict full obs. vector to local analysis domain + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFlocalomi_assimilate_lknetf_nondiagR -- START' + + IF (TRIM(filterstr) == 'LKNETF') THEN + CALL PDAFlocal_assimilate_lknetf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, & + PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, prepoststep_pdaf, & + prodRinvA_l_pdafomi, prodRinvA_hyb_l_pdafomi, & + init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdafomi, & + PDAFomi_g2l_obs_cb, PDAFomi_init_obsvar_cb, & + PDAFomi_init_obsvar_l_cb, likelihood_l_pdafomi, likelihood_hyb_l_pdafomi, & + next_observation_pdaf, outflag) + ELSE + WRITE (*,*) 'PDAF-ERROR: Invalid filter choice for PDAFlocalomi_assimilate_lknetf_nondiagR' + outflag=200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFlocalomi_assimilate_lknetf_nondiagR -- END' + +END SUBROUTINE PDAFlocalomi_assimilate_lknetf_nondiagR diff --git a/src/PDAFlocalomi_assimilate_lknetf_nondiagR_si.F90 b/src/PDAFlocalomi_assimilate_lknetf_nondiagR_si.F90 new file mode 100644 index 000000000..62451ce87 --- /dev/null +++ b/src/PDAFlocalomi_assimilate_lknetf_nondiagR_si.F90 @@ -0,0 +1,85 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocalomi_assimilate_lknetf_nondiagR_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocalomi_assimilate_lknetf_nondiagR_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all domain-localized filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf ! Init state dimension for local ana. domain + EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain + obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain + init_dim_obs_l_pdafomi, & ! Get dimension of obs. vector for local analysis domain + prodRinvA_l_pdafomi, & ! Provide product R^-1 A on local analysis domain + prodRinvA_hyb_l_pdafomi, & ! Provide product R^-1 A on local analysis domain with hybrid weight + likelihood_l_pdafomi, & ! Compute observation likelihood for an ensemble member + likelihood_hyb_l_pdafomi ! Compute observation likelihood for an ensemble member with hybrid weight + + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFlocalomi_assimilate_lknetf_nondiagR +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFlocalomi_assimilate_lknetf_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, prodRinvA_l_pdafomi, prodRinvA_hyb_l_pdafomi, & + likelihood_l_pdafomi, likelihood_hyb_l_pdafomi, & + next_observation_pdaf, outflag) + +END SUBROUTINE PDAFlocalomi_assimilate_lknetf_nondiagR_si diff --git a/src/PDAFlocalomi_assimilate_lnetf_nondiagR.F90 b/src/PDAFlocalomi_assimilate_lnetf_nondiagR.F90 new file mode 100644 index 000000000..2d34cb8ec --- /dev/null +++ b/src/PDAFlocalomi_assimilate_lnetf_nondiagR.F90 @@ -0,0 +1,109 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocalomi_assimilate_lnetf_nondiagR --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocalomi_assimilate_lnetf_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, likelihood_l_pdafomi, & + next_observation_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all domain-localized filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf ! Init state dimension for local ana. domain + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of full observation vector + obs_op_pdafomi, & ! Full observation operator + init_dim_obs_l_pdafomi, & ! Initialize local dimimension of obs. vector + likelihood_l_pdafomi ! Compute likelihood and apply localization + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize full observation vector + PDAFomi_init_obs_l_cb, & ! Initialize local observation vector + PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance + PDAFomi_init_obsvar_l_cb, & ! Initialize local mean observation error variance + PDAFomi_g2l_obs_cb ! Restrict full obs. vector to local analysis domain + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFlocalomi_assimilate_lnetf_nondiagR -- START' + + IF (TRIM(filterstr) == 'LNETF') THEN + CALL PDAFlocal_assimilate_lnetf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_l_cb, & + prepoststep_pdaf, likelihood_l_pdafomi, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, & + PDAFomi_g2l_obs_cb, next_observation_pdaf, outflag) + ELSE + WRITE (*,*) 'PDAF-ERROR: Invalid filter choice for PDAFlocalomi_assimilate_lnetf_nondiagR' + outflag=200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFlocalomi_assimilate_lnetf_nondiagR -- END' + +END SUBROUTINE PDAFlocalomi_assimilate_lnetf_nondiagR diff --git a/src/PDAFlocalomi_assimilate_lnetf_nondiagR_si.F90 b/src/PDAFlocalomi_assimilate_lnetf_nondiagR_si.F90 new file mode 100644 index 000000000..88f84b9f7 --- /dev/null +++ b/src/PDAFlocalomi_assimilate_lnetf_nondiagR_si.F90 @@ -0,0 +1,82 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocalomi_assimilate_lnetf_nondiagR_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocalomi_assimilate_lnetf_nondiagR_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all domain-localized filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf ! Init state dimension for local ana. domain + EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain + obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain + init_dim_obs_l_pdafomi, & ! Get dimension of obs. vector for local analysis domain + likelihood_l_pdafomi ! Compute likelihood and apply localization + + + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFlocalomi_assimilate_lnetf_nondiagR +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFlocalomi_assimilate_lnetf_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, likelihood_l_pdafomi, & + next_observation_pdaf, outflag) + +END SUBROUTINE PDAFlocalomi_assimilate_lnetf_nondiagR_si diff --git a/src/PDAFlocalomi_assimilate_nondiagR.F90 b/src/PDAFlocalomi_assimilate_nondiagR.F90 new file mode 100644 index 000000000..dbd917ee8 --- /dev/null +++ b/src/PDAFlocalomi_assimilate_nondiagR.F90 @@ -0,0 +1,130 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocalomi_assimilate_nondiagR --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocalomi_assimilate_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, prodRinvA_l_pdafomi, & + next_observation_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all domain-localized filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-07 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf ! Init state dimension for local ana. domain + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of full observation vector + obs_op_pdafomi, & ! Full observation operator + init_dim_obs_l_pdafomi, & ! Initialize local dimimension of obs. vector + prodRinvA_l_pdafomi ! Provide product of inverse of R with matrix A + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize full observation vector + PDAFomi_init_obs_l_cb, & ! Initialize local observation vector + PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance + PDAFomi_init_obsvar_l_cb, & ! Initialize local mean observation error variance + PDAFomi_g2l_obs_cb ! Restrict full obs. vector to local analysis domain + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFlocalomi_assimilate_nondiagR -- START' + + IF (TRIM(filterstr) == 'LSEIK') THEN + CALL PDAFlocal_assimilate_lseik(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, & + prepoststep_pdaf, prodRinvA_l_pdafomi, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, & + PDAFomi_g2l_obs_cb, PDAFomi_init_obsvar_cb, PDAFomi_init_obsvar_l_cb, & + next_observation_pdaf, outflag) + ELSE IF (TRIM(filterstr) == 'LETKF') THEN + CALL PDAFlocal_assimilate_letkf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, & + prepoststep_pdaf, prodRinvA_l_pdafomi, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, & + PDAFomi_g2l_obs_cb, PDAFomi_init_obsvar_cb, PDAFomi_init_obsvar_l_cb, & + next_observation_pdaf, outflag) + ELSE IF (TRIM(filterstr) == 'LESTKF') THEN + CALL PDAFlocal_assimilate_lestkf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, & + prepoststep_pdaf, prodRinvA_l_pdafomi, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, & + PDAFomi_g2l_obs_cb, PDAFomi_init_obsvar_cb, PDAFomi_init_obsvar_l_cb, & + next_observation_pdaf, outflag) + ELSE IF (TRIM(filterstr) == 'LNETF') THEN + WRITE (*,*) 'PDAF-ERROR: Use PDAFlocalomi_assimilate_lnetf_nondiagR for LNETF' + outflag=200 + ELSE IF (TRIM(filterstr) == 'LKNETF') THEN + WRITE (*,*) 'PDAF-ERROR: Use PDAFlocalomi_assimilate_lknetf_nondiagR for LKNETF' + outflag=200 + ELSE + WRITE (*,*) 'PDAF-ERROR: Invalid filter choice for PDAFlocalomi_assimilate_nondiagR' + outflag=200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFlocalomi_assimilate_nondiagR -- END' + +END SUBROUTINE PDAFlocalomi_assimilate_nondiagR diff --git a/src/PDAFlocalomi_assimilate_nondiagR_si.F90 b/src/PDAFlocalomi_assimilate_nondiagR_si.F90 new file mode 100644 index 000000000..51ecceaae --- /dev/null +++ b/src/PDAFlocalomi_assimilate_nondiagR_si.F90 @@ -0,0 +1,81 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocalomi_assimilate_nondiagR_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocalomi_assimilate_nondiagR_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all domain-localized filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-07 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf ! Init state dimension for local ana. domain + EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain + obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain + init_dim_obs_l_pdafomi, & ! Get dimension of obs. vector for local analysis domain + prodRinvA_l_pdafomi ! Provide product of inverse of R with matrix A + + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFlocalomi_assimilate_nondiagR +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFlocalomi_assimilate_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, prodRinvA_l_pdafomi, & + next_observation_pdaf, outflag) + +END SUBROUTINE PDAFlocalomi_assimilate_nondiagR_si diff --git a/src/PDAFlocalomi_assimilate_si.F90 b/src/PDAFlocalomi_assimilate_si.F90 new file mode 100644 index 000000000..f98a2e2ee --- /dev/null +++ b/src/PDAFlocalomi_assimilate_si.F90 @@ -0,0 +1,81 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocalomi_assimilate_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocalomi_assimilate_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all domain-localized filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2021-10 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf ! Init state dimension for local ana. domain + EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain + obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain + init_dim_obs_l_pdafomi, & ! Get dimension of obs. vector for local analysis domain + localize_covar_pdafomi ! Apply localization to covariance matrix in LEnKF + + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFlocalomi_assimilate +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFlocalomi_assimilate(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, & + next_observation_pdaf, outflag) + +END SUBROUTINE PDAFlocalomi_assimilate_si diff --git a/src/PDAFlocalomi_put_state.F90 b/src/PDAFlocalomi_put_state.F90 new file mode 100644 index 000000000..272e2237a --- /dev/null +++ b/src/PDAFlocalomi_put_state.F90 @@ -0,0 +1,124 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocalomi_put_state --- Interface to PDAF for domain-local filters +! +! !INTERFACE: +SUBROUTINE PDAFlocalomi_put_state(collect_state_pdaf, init_dim_obs_f_pdaf, obs_op_f_pdaf, & + prepoststep_pdaf, init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdaf, & + outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all domain-localized filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2020-11 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector + obs_op_f_pdaf, & ! Full observation operator + init_dim_obs_l_pdaf ! Initialize local dimimension of obs. vector + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize full observation vector + PDAFomi_init_obs_l_cb, & ! Initialize local observation vector + PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance + PDAFomi_init_obsvar_l_cb, & ! Initialize local mean observation error variance + PDAFomi_g2l_obs_cb, & ! Restrict full obs. vector to local analysis domain + PDAFomi_prodRinvA_l_cb, & ! Provide product R^-1 A on local analysis domain + PDAFomi_likelihood_l_cb ! Compute likelihood and apply localization + EXTERNAL :: PDAFomi_prodRinvA_hyb_l_cb, & ! Product R^-1 A on local analysis domain with hybrid weight + PDAFomi_likelihood_hyb_l_cb ! Compute likelihood and apply localization with tempering + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (TRIM(filterstr) == 'LSEIK') THEN + CALL PDAFlocal_put_state_lseik(collect_state_pdaf, init_dim_obs_f_pdaf, obs_op_f_pdaf, & + PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, prepoststep_pdaf, & + PDAFomi_prodRinvA_l_cb, init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdaf, & + PDAFomi_g2l_obs_cb, PDAFomi_init_obsvar_cb, & + PDAFomi_init_obsvar_l_cb, outflag) + ELSE IF (TRIM(filterstr) == 'LETKF') THEN + CALL PDAFlocal_put_state_letkf(collect_state_pdaf, init_dim_obs_f_pdaf, obs_op_f_pdaf, & + PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, prepoststep_pdaf, & + PDAFomi_prodRinvA_l_cb, init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdaf, & + PDAFomi_g2l_obs_cb, PDAFomi_init_obsvar_cb, & + PDAFomi_init_obsvar_l_cb, outflag) + ELSE IF (TRIM(filterstr) == 'LESTKF') THEN + CALL PDAFlocal_put_state_lestkf(collect_state_pdaf, init_dim_obs_f_pdaf, obs_op_f_pdaf, & + PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, prepoststep_pdaf, & + PDAFomi_prodRinvA_l_cb, init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdaf, & + PDAFomi_g2l_obs_cb, PDAFomi_init_obsvar_cb, & + PDAFomi_init_obsvar_l_cb, outflag) + ELSE IF (TRIM(filterstr) == 'LNETF') THEN + CALL PDAFlocal_put_state_lnetf(collect_state_pdaf, init_dim_obs_f_pdaf, obs_op_f_pdaf, & + PDAFomi_init_obs_l_cb, prepoststep_pdaf, PDAFomi_likelihood_l_cb, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdaf, & + PDAFomi_g2l_obs_cb, outflag) + ELSE IF (TRIM(filterstr) == 'LKNETF') THEN + CALL PDAFlocal_put_state_lknetf(collect_state_pdaf, init_dim_obs_f_pdaf, obs_op_f_pdaf, & + PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, prepoststep_pdaf, & + PDAFomi_prodRinvA_l_cb, PDAFomi_prodRinvA_hyb_l_cb, & + init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdaf, & + PDAFomi_g2l_obs_cb, PDAFomi_init_obsvar_cb, & + PDAFomi_init_obsvar_l_cb, PDAFomi_likelihood_l_cb, PDAFomi_likelihood_hyb_l_cb, outflag) + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + +END SUBROUTINE PDAFlocalomi_put_state diff --git a/src/PDAFlocalomi_put_state_en3dvar_lestkf.F90 b/src/PDAFlocalomi_put_state_en3dvar_lestkf.F90 new file mode 100644 index 000000000..2b7606430 --- /dev/null +++ b/src/PDAFlocalomi_put_state_en3dvar_lestkf.F90 @@ -0,0 +1,109 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocalomi_put_state_en3dvar_lestkf --- Interface to PDAF for En3D-Var/LESTKF +! +! !INTERFACE: +SUBROUTINE PDAFlocalomi_put_state_en3dvar_lestkf(collect_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & + init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdaf, & + prepoststep_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2021-04 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix + obs_op_lin_pdaf, & ! Linearized observation operator + obs_op_adj_pdaf ! Adjoint observation operator + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector + obs_op_f_pdaf, & ! Full observation operator + init_dim_obs_l_pdaf ! Initialize local dimimension of obs. vector + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector + PDAFomi_init_obs_l_cb, & ! Initialize local observation vector + PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance + PDAFomi_init_obsvar_l_cb, & ! Initialize local mean observation error variance + PDAFomi_prodRinvA_cb, & ! Provide product R^-1 A + PDAFomi_g2l_obs_cb, & ! Restrict full obs. vector to local analysis domain + PDAFomi_prodRinvA_l_cb, & ! Provide product R^-1 A on local analysis domain + PDAFomi_likelihood_l_cb ! Compute likelihood and apply localization + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (TRIM(filterstr) == '3DVAR') THEN + CALL PDAFlocal_put_state_en3dvar_lestkf(collect_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, PDAFomi_init_obs_f_cb, PDAFomi_prodRinvA_cb, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, & + PDAFomi_prodRinvA_l_cb, init_n_domains_pdaf, init_dim_l_pdaf, & + init_dim_obs_l_pdaf, PDAFomi_g2l_obs_cb, & + PDAFomi_init_obsvar_cb, PDAFomi_init_obsvar_l_cb, prepoststep_pdaf, outflag) + ELSE + WRITE (*,*) 'PDAF-ERROR: No valid filter type for PDAFlocalomi_put_state_3dvar' + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + +END SUBROUTINE PDAFlocalomi_put_state_en3dvar_lestkf diff --git a/src/PDAFlocalomi_put_state_en3dvar_lestkf_nondiagR.F90 b/src/PDAFlocalomi_put_state_en3dvar_lestkf_nondiagR.F90 new file mode 100644 index 000000000..be6babc0b --- /dev/null +++ b/src/PDAFlocalomi_put_state_en3dvar_lestkf_nondiagR.F90 @@ -0,0 +1,115 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocalomi_put_state_en3dvar_lestkf_nondiagR --- Interface to PDAF for En3D-Var/LESTKF +! +! !INTERFACE: +SUBROUTINE PDAFlocalomi_put_state_en3dvar_lestkf_nondiagR(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prodRinvA_pdafomi, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdafomi, obs_op_adj_pdafomi, & + prodRinvA_l_pdafomi, init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdafomi, & + prepoststep_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf ! Apply adjoint control vector transform matrix + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf ! Init state dimension for local ana. domain + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of full observation vector + obs_op_pdafomi, & ! Full observation operator + obs_op_lin_pdafomi, & ! Linearized observation operator + obs_op_adj_pdafomi, & ! Adjoint observation operator + init_dim_obs_l_pdafomi, & ! Initialize local dimimension of obs. vector + prodRinvA_pdafomi, & ! Provide product R^-1 A + prodRinvA_l_pdafomi ! Provide product R^-1 A + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector + PDAFomi_init_obs_l_cb, & ! Initialize local observation vector + PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance + PDAFomi_init_obsvar_l_cb, & ! Initialize local mean observation error variance + PDAFomi_g2l_obs_cb ! Restrict full obs. vector to local analysis domain + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFlocalomi_put_state_en3dvar_lestkf_nondiagR -- START' + + IF (TRIM(filterstr) == '3DVAR') THEN + CALL PDAFlocal_put_state_en3dvar_lestkf(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, prodRinvA_pdafomi, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdafomi, obs_op_adj_pdafomi, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, & + prodRinvA_l_pdafomi, init_n_domains_pdaf, init_dim_l_pdaf, & + init_dim_obs_l_pdafomi, PDAFomi_g2l_obs_cb, & + PDAFomi_init_obsvar_cb, PDAFomi_init_obsvar_l_cb, prepoststep_pdaf, outflag) + ELSE + WRITE (*,*) 'PDAF-ERROR: No valid filter type for PDAFlocalomi_put_state_en3dvar_lestkf_nondiagR' + outflag = 200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFlocalomi_put_state_en3dvar_lestkf_nondiagR -- END' + +END SUBROUTINE PDAFlocalomi_put_state_en3dvar_lestkf_nondiagR diff --git a/src/PDAFlocalomi_put_state_hyb3dvar_lestkf.F90 b/src/PDAFlocalomi_put_state_hyb3dvar_lestkf.F90 new file mode 100644 index 000000000..5d4db2bc3 --- /dev/null +++ b/src/PDAFlocalomi_put_state_hyb3dvar_lestkf.F90 @@ -0,0 +1,111 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocalomi_put_state_hyb3dvar_lestkf --- Interface to PDAF for Hyb3D-Var/LESTKF +! +! !INTERFACE: +SUBROUTINE PDAFlocalomi_put_state_hyb3dvar_lestkf(collect_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, cvt_pdaf, cvt_adj_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & + init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdaf, & + prepoststep_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2021-04 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix + cvt_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_pdaf, & ! Apply adjoint control vector transform matrix + obs_op_lin_pdaf, & ! Linearized observation operator + obs_op_adj_pdaf ! Adjoint observation operator + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + init_dim_obs_f_pdaf, & ! Initialize dimension of full observation vector + obs_op_f_pdaf, & ! Full observation operator + init_dim_obs_l_pdaf ! Initialize local dimimension of obs. vector + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector + PDAFomi_init_obs_l_cb, & ! Initialize local observation vector + PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance + PDAFomi_init_obsvar_l_cb, & ! Initialize local mean observation error variance + PDAFomi_prodRinvA_cb, & ! Provide product R^-1 A + PDAFomi_g2l_obs_cb, & ! Restrict full obs. vector to local analysis domain + PDAFomi_prodRinvA_l_cb, & ! Provide product R^-1 A on local analysis domain + PDAFomi_likelihood_l_cb ! Compute likelihood and apply localization + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (TRIM(filterstr) == '3DVAR') THEN + CALL PDAFlocal_put_state_hyb3dvar_lestkf(collect_state_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, PDAFomi_init_obs_f_cb, PDAFomi_prodRinvA_cb, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, cvt_pdaf, cvt_adj_pdaf, obs_op_lin_pdaf, obs_op_adj_pdaf, & + init_dim_obs_f_pdaf, obs_op_f_pdaf, PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, & + PDAFomi_prodRinvA_l_cb, init_n_domains_pdaf, init_dim_l_pdaf, & + init_dim_obs_l_pdaf, PDAFomi_g2l_obs_cb, & + PDAFomi_init_obsvar_cb, PDAFomi_init_obsvar_l_cb, prepoststep_pdaf, outflag) + ELSE + WRITE (*,*) 'PDAF-ERROR: No valid filter type for PDAFlocalomi_put_state_3dvar' + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + +END SUBROUTINE PDAFlocalomi_put_state_hyb3dvar_lestkf diff --git a/src/PDAFlocalomi_put_state_hyb3dvar_lestkf_nondiagR.F90 b/src/PDAFlocalomi_put_state_hyb3dvar_lestkf_nondiagR.F90 new file mode 100644 index 000000000..890a8a32c --- /dev/null +++ b/src/PDAFlocalomi_put_state_hyb3dvar_lestkf_nondiagR.F90 @@ -0,0 +1,119 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocalomi_put_state_hyb3dvar_lestkf_nondiagR --- Interface to PDAF for Hyb3D-Var/LESTKF +! +! !INTERFACE: +SUBROUTINE PDAFlocalomi_put_state_hyb3dvar_lestkf_nondiagR(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prodRinvA_pdafomi, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, cvt_pdaf, cvt_adj_pdaf, & + obs_op_lin_pdafomi, obs_op_adj_pdafomi, & + prodRinvA_l_pdafomi, init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdafomi, & + prepoststep_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix + cvt_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_pdaf ! Apply adjoint control vector transform matrix + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf ! Init state dimension for local ana. domain + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of full observation vector + obs_op_pdafomi, & ! Full observation operator + obs_op_lin_pdafomi, & ! Linearized observation operator + obs_op_adj_pdafomi, & ! Adjoint observation operator + init_dim_obs_l_pdafomi, & ! Initialize local dimimension of obs. vector + prodRinvA_pdafomi, & ! Provide product R^-1 A + prodRinvA_l_pdafomi ! Provide product R^-1 A + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector + PDAFomi_init_obs_l_cb, & ! Initialize local observation vector + PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance + PDAFomi_init_obsvar_l_cb, & ! Initialize local mean observation error variance + PDAFomi_prodRinvA_cb, & ! Provide product R^-1 A + PDAFomi_g2l_obs_cb ! Restrict full obs. vector to local analysis domain + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFlocalomi_put_state_hyb3dvar_lestkf_nondiagR -- START' + + IF (TRIM(filterstr) == '3DVAR') THEN + CALL PDAFlocal_put_state_hyb3dvar_lestkf(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, prodRinvA_pdafomi, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, cvt_pdaf, cvt_adj_pdaf, obs_op_lin_pdafomi, obs_op_adj_pdafomi, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, & + prodRinvA_l_pdafomi, init_n_domains_pdaf, init_dim_l_pdaf, & + init_dim_obs_l_pdafomi, PDAFomi_g2l_obs_cb, & + PDAFomi_init_obsvar_cb, PDAFomi_init_obsvar_l_cb, prepoststep_pdaf, outflag) + ELSE + WRITE (*,*) 'PDAF-ERROR: No valid filter type for PDAFlocalomi_put_state_hyb3dvar_lestkf_nondiagR' + outflag = 200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFlocalomi_put_state_hyb3dvar_lestkf_nondiagR -- END' + +END SUBROUTINE PDAFlocalomi_put_state_hyb3dvar_lestkf_nondiagR diff --git a/src/PDAFlocalomi_put_state_lknetf_nondiagR.F90 b/src/PDAFlocalomi_put_state_lknetf_nondiagR.F90 new file mode 100644 index 000000000..9750e98d6 --- /dev/null +++ b/src/PDAFlocalomi_put_state_lknetf_nondiagR.F90 @@ -0,0 +1,113 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocalomi_put_state_lknetf_nondiagR --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocalomi_put_state_lknetf_nondiagR(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, prodRinvA_l_pdafomi, prodRinvA_hyb_l_pdafomi, & + likelihood_l_pdafomi, likelihood_hyb_l_pdafomi, & + outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all domain-localized filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf ! Init state dimension for local ana. domain + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of full observation vector + obs_op_pdafomi, & ! Full observation operator + init_dim_obs_l_pdafomi, & ! Initialize local dimimension of obs. vector + prodRinvA_l_pdafomi, & ! Provide product R^-1 A on local analysis domain + likelihood_l_pdafomi, & ! Compute likelihood and apply localization + prodRinvA_hyb_l_pdafomi, & ! Product R^-1 A on local analysis domain with hybrid weight + likelihood_hyb_l_pdafomi ! Compute likelihood and apply localization with tempering + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize full observation vector + PDAFomi_init_obs_l_cb, & ! Initialize local observation vector + PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance + PDAFomi_init_obsvar_l_cb, & ! Initialize local mean observation error variance + PDAFomi_g2l_obs_cb ! Restrict full obs. vector to local analysis domain + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFlocalomi_put_state_lknetf_nondiagR -- START' + + IF (TRIM(filterstr) == 'LKNETF') THEN + CALL PDAFlocal_put_state_lknetf(collect_state_pdaf, init_dim_obs_pdafomi, obs_op_pdafomi, & + PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, prepoststep_pdaf, & + prodRinvA_l_pdafomi, prodRinvA_hyb_l_pdafomi, & + init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdafomi, & + PDAFomi_g2l_obs_cb, PDAFomi_init_obsvar_cb, & + PDAFomi_init_obsvar_l_cb, likelihood_l_pdafomi, likelihood_hyb_l_pdafomi, & + outflag) + ELSE + WRITE (*,*) 'PDAF-ERROR: Invalid filter choice for PDAFlocalomi_put_state_lknetf_nondiagR' + outflag=200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFlocalomi_put_state_lknetf_nondiagR -- END' + +END SUBROUTINE PDAFlocalomi_put_state_lknetf_nondiagR diff --git a/src/PDAFlocalomi_put_state_lknetf_nondiagR_si.F90 b/src/PDAFlocalomi_put_state_lknetf_nondiagR_si.F90 new file mode 100644 index 000000000..4ba77d36f --- /dev/null +++ b/src/PDAFlocalomi_put_state_lknetf_nondiagR_si.F90 @@ -0,0 +1,83 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocalomi_put_state_lknetf_nondiagR_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocalomi_put_state_lknetf_nondiagR_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all domain-localized filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf ! Init state dimension for local ana. domain + EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain + obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain + init_dim_obs_l_pdafomi, & ! Get dimension of obs. vector for local analysis domain + prodRinvA_l_pdafomi, & ! Provide product R^-1 A on local analysis domain + prodRinvA_hyb_l_pdafomi, & ! Provide product R^-1 A on local analysis domain with hybrid weight + likelihood_l_pdafomi, & ! Compute observation likelihood for an ensemble member + likelihood_hyb_l_pdafomi ! Compute observation likelihood for an ensemble member with hybrid weight + + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFlocalomi_put_state_lknetf_nondiagR +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFlocalomi_put_state_lknetf_nondiagR(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, prodRinvA_l_pdafomi, prodRinvA_hyb_l_pdafomi, & + likelihood_l_pdafomi, likelihood_hyb_l_pdafomi, & + outflag) + +END SUBROUTINE PDAFlocalomi_put_state_lknetf_nondiagR_si diff --git a/src/PDAFlocalomi_put_state_lnetf_nondiagR.F90 b/src/PDAFlocalomi_put_state_lnetf_nondiagR.F90 new file mode 100644 index 000000000..91956b47c --- /dev/null +++ b/src/PDAFlocalomi_put_state_lnetf_nondiagR.F90 @@ -0,0 +1,106 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocalomi_put_state_lnetf_nondiagR --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocalomi_put_state_lnetf_nondiagR(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, likelihood_l_pdafomi, & + outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all domain-localized filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf ! Init state dimension for local ana. domain + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of full observation vector + obs_op_pdafomi, & ! Full observation operator + init_dim_obs_l_pdafomi, & ! Initialize local dimimension of obs. vector + likelihood_l_pdafomi ! Compute likelihood and apply localization + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize full observation vector + PDAFomi_init_obs_l_cb, & ! Initialize local observation vector + PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance + PDAFomi_init_obsvar_l_cb, & ! Initialize local mean observation error variance + PDAFomi_g2l_obs_cb ! Restrict full obs. vector to local analysis domain + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFlocalomi_put_state_lnetf_nondiagR -- START' + + IF (TRIM(filterstr) == 'LNETF') THEN + CALL PDAFlocal_put_state_lnetf(collect_state_pdaf, init_dim_obs_pdafomi, obs_op_pdafomi, & + PDAFomi_init_obs_l_cb, prepoststep_pdaf, likelihood_l_pdafomi, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, & + PDAFomi_g2l_obs_cb, outflag) + ELSE + WRITE (*,*) 'PDAF-ERROR: Invalid filter choice for PDAFlocalomi_put_state_lnetf_nondiagR' + outflag=200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFlocalomi_put_state_lnetf_nondiagR -- END' + +END SUBROUTINE PDAFlocalomi_put_state_lnetf_nondiagR diff --git a/src/PDAFlocalomi_put_state_lnetf_nondiagR_si.F90 b/src/PDAFlocalomi_put_state_lnetf_nondiagR_si.F90 new file mode 100644 index 000000000..dd2ad67a9 --- /dev/null +++ b/src/PDAFlocalomi_put_state_lnetf_nondiagR_si.F90 @@ -0,0 +1,80 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocalomi_put_state_lnetf_nondiagR_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocalomi_put_state_lnetf_nondiagR_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all domain-localized filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf ! Init state dimension for local ana. domain + EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain + obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain + init_dim_obs_l_pdafomi, & ! Get dimension of obs. vector for local analysis domain + likelihood_l_pdafomi ! Compute likelihood and apply localization + + + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFlocalomi_put_state_lnetf_nondiagR +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFlocalomi_put_state_lnetf_nondiagR(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, likelihood_l_pdafomi, & + outflag) + +END SUBROUTINE PDAFlocalomi_put_state_lnetf_nondiagR_si diff --git a/src/PDAFlocalomi_put_state_nondiagR.F90 b/src/PDAFlocalomi_put_state_nondiagR.F90 new file mode 100644 index 000000000..5e1d2c2af --- /dev/null +++ b/src/PDAFlocalomi_put_state_nondiagR.F90 @@ -0,0 +1,125 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocalomi_put_state_nondiagR --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocalomi_put_state_nondiagR(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, prodRinvA_l_pdafomi, & + outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all domain-localized filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-07 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf ! Init state dimension for local ana. domain + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of full observation vector + obs_op_pdafomi, & ! Full observation operator + init_dim_obs_l_pdafomi, & ! Initialize local dimimension of obs. vector + prodRinvA_l_pdafomi ! Provide product of inverse of R with matrix A + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize full observation vector + PDAFomi_init_obs_l_cb, & ! Initialize local observation vector + PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance + PDAFomi_init_obsvar_l_cb, & ! Initialize local mean observation error variance + PDAFomi_g2l_obs_cb ! Restrict full obs. vector to local analysis domain + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFlocalomi_put_state_nondiagR -- START' + + IF (TRIM(filterstr) == 'LSEIK') THEN + CALL PDAFlocal_put_state_lseik(collect_state_pdaf, init_dim_obs_pdafomi, obs_op_pdafomi, & + PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, prepoststep_pdaf, & + prodRinvA_l_pdafomi, init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdafomi, & + PDAFomi_g2l_obs_cb, PDAFomi_init_obsvar_cb, & + PDAFomi_init_obsvar_l_cb, outflag) + ELSE IF (TRIM(filterstr) == 'LETKF') THEN + CALL PDAFlocal_put_state_letkf(collect_state_pdaf, init_dim_obs_pdafomi, obs_op_pdafomi, & + PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, prepoststep_pdaf, & + prodRinvA_l_pdafomi, init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdafomi, & + PDAFomi_g2l_obs_cb, PDAFomi_init_obsvar_cb, & + PDAFomi_init_obsvar_l_cb, outflag) + ELSE IF (TRIM(filterstr) == 'LESTKF') THEN + CALL PDAFlocal_put_state_lestkf(collect_state_pdaf, init_dim_obs_pdafomi, obs_op_pdafomi, & + PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, prepoststep_pdaf, & + prodRinvA_l_pdafomi, init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdafomi, & + PDAFomi_g2l_obs_cb, PDAFomi_init_obsvar_cb, & + PDAFomi_init_obsvar_l_cb, outflag) + ELSE IF (TRIM(filterstr) == 'LNETF') THEN + WRITE (*,*) 'PDAF-ERROR: Use PDAFlocalomi_put_state_lnetf_nondiagR for LNETF' + outflag=200 + ELSE IF (TRIM(filterstr) == 'LKNETF') THEN + WRITE (*,*) 'PDAF-ERROR: Use PDAFlocalomi_put_state_lknetf_nondiagR for LKNETF' + outflag=200 + ELSE + WRITE (*,*) 'PDAF-ERROR: Invalid filter choice for PDAFlocalomi_put_state_nondiagR' + outflag=200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFlocalomi_put_state_nondiagR -- END' + +END SUBROUTINE PDAFlocalomi_put_state_nondiagR diff --git a/src/PDAFlocalomi_put_state_nondiagR_si.F90 b/src/PDAFlocalomi_put_state_nondiagR_si.F90 new file mode 100644 index 000000000..fb21b3622 --- /dev/null +++ b/src/PDAFlocalomi_put_state_nondiagR_si.F90 @@ -0,0 +1,79 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocalomi_put_state_nondiagR_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocalomi_put_state_nondiagR_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all domain-localized filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-07 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf ! Init state dimension for local ana. domain + EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain + obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain + init_dim_obs_l_pdafomi, & ! Get dimension of obs. vector for local analysis domain + prodRinvA_l_pdafomi ! Provide product of inverse of R with matrix A + + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFlocalomi_put_state_nondiagR +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFlocalomi_put_state_nondiagR(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, prodRinvA_l_pdafomi, & + outflag) + +END SUBROUTINE PDAFlocalomi_put_state_nondiagR_si diff --git a/src/PDAFlocalomi_put_state_si.F90 b/src/PDAFlocalomi_put_state_si.F90 new file mode 100644 index 000000000..f3ad304c5 --- /dev/null +++ b/src/PDAFlocalomi_put_state_si.F90 @@ -0,0 +1,79 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFlocalomi_put_state_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFlocalomi_put_state_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model after the +! forecast of each ensemble state to transfer data +! from the model to PDAF. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all domain-localized filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2021-10 - Lars Nerger - Initial code +! 2024-08 - Yumeng Chen - Initial code based on non-PDAFlocal routine +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + ! Localization of state vector + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf ! Initialize state dimension for local analysis domain + ! Interface to PDAF-OMI for local and global filters + EXTERNAL :: & + init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain + obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain + init_dim_obs_l_pdafomi, & ! Get dimension of obs. vector for local analysis domain + localize_covar_pdafomi ! Apply localization to covariance matrix in LEnKF + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFlocalomi_put_state +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFlocalomi_put_state(collect_state_pdaf, init_dim_obs_pdafomi, & + obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, init_dim_l_pdaf, & + init_dim_obs_l_pdafomi, outflag) + +END SUBROUTINE PDAFlocalomi_put_state_si diff --git a/src/PDAFomi.F90 b/src/PDAFomi.F90 index 3525001df..f1c92bebf 100644 --- a/src/PDAFomi.F90 +++ b/src/PDAFomi.F90 @@ -31,6 +31,7 @@ MODULE PDAFomi USE PDAFomi_obs_f USE PDAFomi_obs_l + USE PDAFomi_dim_obs_l USE PDAFomi_obs_op END MODULE PDAFomi diff --git a/src/PDAFomi_assimilate_3dvar_nondiagR.F90 b/src/PDAFomi_assimilate_3dvar_nondiagR.F90 new file mode 100644 index 000000000..b8694d0b4 --- /dev/null +++ b/src/PDAFomi_assimilate_3dvar_nondiagR.F90 @@ -0,0 +1,103 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_assimilate_3dvar_nondiagR --- Interface to PDAF for 3D-Var +! +! !INTERFACE: +SUBROUTINE PDAFomi_assimilate_3dvar_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prodRinvA_pdafomi, & + cvt_pdaf, cvt_adj_pdaf, obs_op_lin_pdafomi, obs_op_adj_pdafomi, & + prepoststep_pdaf, next_observation_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_pdaf ! Apply adjoint control vector transform matrix + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of observation vector + obs_op_pdafomi, & ! Observation operator + obs_op_lin_pdafomi, & ! Linearized observation operator + obs_op_adj_pdafomi, & ! Adjoint observation operator + prodRinvA_pdafomi ! Provide product R^-1 A + EXTERNAL :: PDAFomi_init_obs_f_cb ! Initialize observation vector + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_assimilate_3dvar_nondiagR -- START' + + IF (TRIM(filterstr) == '3DVAR') THEN + CALL PDAF_assimilate_3dvar(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, prodRinvA_pdafomi, & + cvt_pdaf, cvt_adj_pdaf, obs_op_lin_pdafomi, obs_op_adj_pdafomi, & + prepoststep_pdaf, next_observation_pdaf, outflag) + ELSE + WRITE (*,*) 'PDAF-ERROR: No valid filter type for PDAFomi_assimilate_3dvar_nondiagR' + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_assimilate_3dvar_nondiagR -- END' + +END SUBROUTINE PDAFomi_assimilate_3dvar_nondiagR diff --git a/src/PDAFomi_assimilate_en3dvar_estkf.F90 b/src/PDAFomi_assimilate_en3dvar_estkf.F90 index cf0e33700..7fae8e256 100644 --- a/src/PDAFomi_assimilate_en3dvar_estkf.F90 +++ b/src/PDAFomi_assimilate_en3dvar_estkf.F90 @@ -60,18 +60,15 @@ SUBROUTINE PDAFomi_assimilate_en3dvar_estkf(collect_state_pdaf, distribute_state distribute_state_pdaf, & ! Routine to distribute a state vector next_observation_pdaf, & ! Provide time step, time and dimension of next observation prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf ! Apply adjoint control vector transform matrix EXTERNAL :: init_dim_obs_pdaf, & ! Initialize dimension of observation vector obs_op_pdaf, & ! Observation operator - cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector - cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix obs_op_lin_pdaf, & ! Linearized observation operator obs_op_adj_pdaf ! Adjoint observation operator EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance - PDAFomi_init_obscovar_cb, & ! Initialize mean observation error variance - PDAFomi_add_obs_error_cb, & ! Add observation error covariance matrix - PDAFomi_prodRinvA_cb, & ! Provide product R^-1 A - PDAFomi_likelihood_cb ! Compute likelihood + PDAFomi_prodRinvA_cb ! Provide product R^-1 A ! !CALLING SEQUENCE: ! Called by: model code diff --git a/src/PDAFomi_assimilate_en3dvar_estkf_nondiagR.F90 b/src/PDAFomi_assimilate_en3dvar_estkf_nondiagR.F90 new file mode 100644 index 000000000..7fac7af03 --- /dev/null +++ b/src/PDAFomi_assimilate_en3dvar_estkf_nondiagR.F90 @@ -0,0 +1,105 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_assimilate_en3dvar_estkf_nondiagR --- Interface to PDAF for En3D-Var/ESTKF +! +! !INTERFACE: +SUBROUTINE PDAFomi_assimilate_en3dvar_estkf_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prodRinvA_pdafomi, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdafomi, obs_op_adj_pdafomi, & + prepoststep_pdaf, next_observation_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf ! Apply adjoint control vector transform matrix + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of observation vector + prodRinvA_pdafomi, & ! Provide product R^-1 A + obs_op_pdafomi, & ! Observation operator + obs_op_lin_pdafomi, & ! Linearized observation operator + obs_op_adj_pdafomi ! Adjoint observation operator + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector + PDAFomi_init_obsvar_cb ! Initialize mean observation error variance + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_assimilate_en3dvar_estkf_nondiagR -- START' + + IF (TRIM(filterstr) == '3DVAR') THEN + CALL PDAF_assimilate_en3dvar_estkf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, prodRinvA_pdafomi, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdafomi, obs_op_adj_pdafomi, & + PDAFomi_init_obsvar_cb, prepoststep_pdaf, next_observation_pdaf, outflag) + ELSE + WRITE (*,*) 'PDAF-ERROR: No valid filter type for PDAFomi_assimilate_en3dvar_estkf_nondiagR' + outflag = 200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_assimilate_en3dvar_estkf_nondiagR -- END' + +END SUBROUTINE PDAFomi_assimilate_en3dvar_estkf_nondiagR diff --git a/src/PDAFomi_assimilate_en3dvar_lestkf_nondiagR.F90 b/src/PDAFomi_assimilate_en3dvar_lestkf_nondiagR.F90 new file mode 100644 index 000000000..b3d181ada --- /dev/null +++ b/src/PDAFomi_assimilate_en3dvar_lestkf_nondiagR.F90 @@ -0,0 +1,119 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_assimilate_en3dvar_lestkf_nondiagR --- Interface to PDAF for En3D-Var/LESTKF +! +! !INTERFACE: +SUBROUTINE PDAFomi_assimilate_en3dvar_lestkf_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prodRinvA_pdafomi, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdafomi, obs_op_adj_pdafomi, & + prodRinvA_l_pdafomi, init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdafomi, & + g2l_state_pdaf, l2g_state_pdaf, prepoststep_pdaf, next_observation_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf ! Apply adjoint control vector transform matrix + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + g2l_state_pdaf, & ! Get state on local ana. domain from full state + l2g_state_pdaf ! Init full state from local state + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of full observation vector + obs_op_pdafomi, & ! Full observation operator + obs_op_lin_pdafomi, & ! Linearized observation operator + obs_op_adj_pdafomi, & ! Adjoint observation operator + init_dim_obs_l_pdafomi, & ! Initialize local dimimension of obs. vector + prodRinvA_pdafomi, & ! Provide product R^-1 A + prodRinvA_l_pdafomi ! Provide product R^-1 A with localization + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector + PDAFomi_init_obs_l_cb, & ! Initialize local observation vector + PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance + PDAFomi_init_obsvar_l_cb, & ! Initialize local mean observation error variance + PDAFomi_g2l_obs_cb ! Restrict full obs. vector to local analysis domain + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_assimilate_en3dvar_lestkf_nondiagR -- START' + + IF (TRIM(filterstr) == '3DVAR') THEN + CALL PDAF_assimilate_en3dvar_lestkf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, prodRinvA_pdafomi, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdafomi, obs_op_adj_pdafomi, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, & + prodRinvA_l_pdafomi, init_n_domains_pdaf, init_dim_l_pdaf, & + init_dim_obs_l_pdafomi, g2l_state_pdaf, l2g_state_pdaf, PDAFomi_g2l_obs_cb, & + PDAFomi_init_obsvar_cb, PDAFomi_init_obsvar_l_cb, & + prepoststep_pdaf, next_observation_pdaf, outflag) + ELSE + WRITE (*,*) 'PDAF-ERROR: No valid filter type for PDAFomi_assimilate_en3dvar_lestkf_nondiagR' + outflag = 200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_assimilate_en3dvar_lestkf_nondiagR -- END' + +END SUBROUTINE PDAFomi_assimilate_en3dvar_lestkf_nondiagR diff --git a/src/PDAFomi_assimilate_enkf_nondiagR.F90 b/src/PDAFomi_assimilate_enkf_nondiagR.F90 new file mode 100644 index 000000000..b86b2d9e7 --- /dev/null +++ b/src/PDAFomi_assimilate_enkf_nondiagR.F90 @@ -0,0 +1,101 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_assimilate_enkf_nondiagR --- Interface to PDAF for global filters +! +! !INTERFACE: +SUBROUTINE PDAFomi_assimilate_enkf_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, add_obs_error_pdafomi, init_obscovar_pdafomi, & + prepoststep_pdaf, next_observation_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of observation vector + obs_op_pdafomi, & ! Observation operator + init_obscovar_pdafomi, & ! Initialize mean observation error variance + add_obs_error_pdafomi ! Add observation error covariance matrix + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector + PDAFomi_prodRinvA_cb, & ! Provide product R^-1 A + PDAFomi_likelihood_cb ! Compute likelihood + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_assimilate_enkf_nondiagR -- START' + + IF (TRIM(filterstr) == 'ENKF') THEN + CALL PDAF_assimilate_enkf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, prepoststep_pdaf, & + add_obs_error_pdafomi, init_obscovar_pdafomi, next_observation_pdaf, outflag) + ELSE + WRITE (*,*) 'PDAF-ERROR: Invalid filter choice for PDAFomi_assimilate_enkf_nondiagR' + outflag=200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_assimilate_enkf_nondiagR -- END' + +END SUBROUTINE PDAFomi_assimilate_enkf_nondiagR diff --git a/src/PDAFomi_assimilate_enkf_nondiagR_si.F90 b/src/PDAFomi_assimilate_enkf_nondiagR_si.F90 new file mode 100644 index 000000000..413496d8b --- /dev/null +++ b/src/PDAFomi_assimilate_enkf_nondiagR_si.F90 @@ -0,0 +1,77 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_assimilate_enkf_nondiagR_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFomi_assimilate_enkf_nondiagR_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + ! Interface to PDAF-OMI for local and global filters + EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain + obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain + init_obscovar_pdafomi, & ! Initialize mean observation error variance + add_obs_error_pdafomi ! Add observation error covariance matrix + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFomi_assimilate_enkf_nondiagR +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFomi_assimilate_enkf_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, add_obs_error_pdafomi, init_obscovar_pdafomi, & + prepoststep_pdaf, next_observation_pdaf, outflag) + +END SUBROUTINE PDAFomi_assimilate_enkf_nondiagR_si diff --git a/src/PDAFomi_assimilate_global_nondiagR.F90 b/src/PDAFomi_assimilate_global_nondiagR.F90 new file mode 100644 index 000000000..7c6ecb81b --- /dev/null +++ b/src/PDAFomi_assimilate_global_nondiagR.F90 @@ -0,0 +1,118 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_assimilate_global_nondiagR --- Interface to PDAF for global filters +! +! !INTERFACE: +SUBROUTINE PDAFomi_assimilate_global_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdaf, obs_op_pdaf, prodRinvA_pdaf, prepoststep_pdaf, next_observation_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_dim_obs_pdaf, & ! Initialize dimension of observation vector + obs_op_pdaf ! Observation operator + EXTERNAL :: prodRinvA_pdaf ! Provide product R^-1 A + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector + PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance + PDAFomi_init_obscovar_cb, & ! Initialize mean observation error variance + PDAFomi_add_obs_error_cb ! Add observation error covariance matrix + + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_assimilate_global_nondiagR -- START' + + IF (TRIM(filterstr) == 'SEIK') THEN + CALL PDAF_assimilate_seik(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdaf, obs_op_pdaf, PDAFomi_init_obs_f_cb, prepoststep_pdaf, & + prodRinvA_pdaf, PDAFomi_init_obsvar_cb, next_observation_pdaf, outflag) + ELSEIF (TRIM(filterstr) == 'ENKF') THEN + WRITE (*,*) 'PDAF-ERROR: Use PDAFomi_assimilate_enkf_nondiagR for EnKF' + outflag=200 + ELSEIF (TRIM(filterstr) == 'ETKF') THEN + CALL PDAF_assimilate_etkf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdaf, obs_op_pdaf, PDAFomi_init_obs_f_cb, prepoststep_pdaf, & + prodRinvA_pdaf, PDAFomi_init_obsvar_cb, next_observation_pdaf, outflag) + ELSEIF (TRIM(filterstr) == 'ESTKF') THEN + CALL PDAF_assimilate_estkf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdaf, obs_op_pdaf, PDAFomi_init_obs_f_cb, prepoststep_pdaf, & + prodRinvA_pdaf, PDAFomi_init_obsvar_cb, next_observation_pdaf, outflag) + ELSEIF (TRIM(filterstr) == 'NETF') THEN + WRITE (*,*) 'PDAF-ERROR: Use PDAFomi_assimilate_nonlin_nondiagR for NETF and PF' + outflag=200 + ELSEIF (TRIM(filterstr) == 'PF') THEN + WRITE (*,*) 'PDAF-ERROR: Use PDAFomi_assimilate_nonlin_nondiagR for NETF and PF' + outflag=200 + ELSE + WRITE (*,*) 'PDAF-ERROR: Invalid filter choice for PDAFomi_assimilate_global_nondiagR' + outflag=200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_assimilate_global_nondiagR -- END' + +END SUBROUTINE PDAFomi_assimilate_global_nondiagR diff --git a/src/PDAFomi_assimilate_global_nondiagR_si.F90 b/src/PDAFomi_assimilate_global_nondiagR_si.F90 new file mode 100644 index 000000000..3117a2c9d --- /dev/null +++ b/src/PDAFomi_assimilate_global_nondiagR_si.F90 @@ -0,0 +1,76 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_assimilate_global_nondiagR_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFomi_assimilate_global_nondiagR_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + ! Interface to PDAF-OMI for local and global filters + EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain + obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain + prodRinvA_pdafomi ! Provide product R^-1 A + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFomi_assimilate_global_nondiagR +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFomi_assimilate_global_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prodRinvA_pdafomi, prepoststep_pdaf, & + next_observation_pdaf, outflag) + +END SUBROUTINE PDAFomi_assimilate_global_nondiagR_si diff --git a/src/PDAFomi_assimilate_hyb3dvar_estkf_nondiagR.F90 b/src/PDAFomi_assimilate_hyb3dvar_estkf_nondiagR.F90 new file mode 100644 index 000000000..6d8675795 --- /dev/null +++ b/src/PDAFomi_assimilate_hyb3dvar_estkf_nondiagR.F90 @@ -0,0 +1,109 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_assimilate_hyb3dvar_estkf_nondiagR --- Interface to PDAF for Hyb3D-Var/ESTKF +! +! !INTERFACE: +SUBROUTINE PDAFomi_assimilate_hyb3dvar_estkf_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prodRinvA_pdafomi, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, cvt_pdaf, cvt_adj_pdaf, & + obs_op_lin_pdafomi, obs_op_adj_pdafomi, & + prepoststep_pdaf, next_observation_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_pdaf, & ! Apply adjoint control vector transform matrix + cvt_ens_pdaf, & ! Apply ensemble control vector transform matrix to control vector + cvt_adj_ens_pdaf ! Apply adjoint ensemble control vector transform matrix + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of observation vector + obs_op_pdafomi, & ! Observation operator + obs_op_lin_pdafomi, & ! Linearized observation operator + obs_op_adj_pdafomi, & ! Adjoint observation operator + prodRinvA_pdafomi ! Provide product R^-1 A + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector + PDAFomi_init_obsvar_cb ! Initialize mean observation error variance + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_assimilate_hyb3dvar_estkf_nondiagR -- START' + + IF (TRIM(filterstr) == '3DVAR') THEN + CALL PDAF_assimilate_hyb3dvar_estkf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, prodRinvA_pdafomi, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, cvt_pdaf, cvt_adj_pdaf, & + obs_op_lin_pdafomi, obs_op_adj_pdafomi, & + PDAFomi_init_obsvar_cb, prepoststep_pdaf, next_observation_pdaf, outflag) + ELSE + WRITE (*,*) 'PDAF-ERROR: No valid filter type for PDAFomi_assimilate_hyb3dvar_estkf_nondiagR' + outflag = 200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_assimilate_hyb3dvar_estkf_nondiagR -- END' + +END SUBROUTINE PDAFomi_assimilate_hyb3dvar_estkf_nondiagR diff --git a/src/PDAFomi_assimilate_hyb3dvar_lestkf_nondiagR.F90 b/src/PDAFomi_assimilate_hyb3dvar_lestkf_nondiagR.F90 new file mode 100644 index 000000000..11bc0e09d --- /dev/null +++ b/src/PDAFomi_assimilate_hyb3dvar_lestkf_nondiagR.F90 @@ -0,0 +1,123 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_assimilate_hyb3dvar_lestkf_nondiagR --- Interface to PDAF for Hyb3D-Var/LESTKF +! +! !INTERFACE: +SUBROUTINE PDAFomi_assimilate_hyb3dvar_lestkf_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prodRinvA_pdafomi, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, cvt_pdaf, cvt_adj_pdaf, obs_op_lin_pdafomi, obs_op_adj_pdafomi, & + prodRinvA_l_pdafomi, init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdafomi, & + g2l_state_pdaf, l2g_state_pdaf, prepoststep_pdaf, next_observation_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix + cvt_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_pdaf ! Apply adjoint control vector transform matrix + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + g2l_state_pdaf, & ! Get state on local ana. domain from full state + l2g_state_pdaf ! Init full state from local state + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of full observation vector + obs_op_pdafomi, & ! Full observation operator + obs_op_lin_pdafomi, & ! Linearized observation operator + obs_op_adj_pdafomi, & ! Adjoint observation operator + init_dim_obs_l_pdafomi, & ! Initialize local dimimension of obs. vector + prodRinvA_pdafomi, & ! Provide product R^-1 A + prodRinvA_l_pdafomi ! Provide product R^-1 A + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector + PDAFomi_init_obs_l_cb, & ! Initialize local observation vector + PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance + PDAFomi_init_obsvar_l_cb, & ! Initialize local mean observation error variance + PDAFomi_prodRinvA_cb, & ! Provide product R^-1 A + PDAFomi_g2l_obs_cb ! Restrict full obs. vector to local analysis domain + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_assimilate_hyb3dvar_lestkf_nondiagR -- START' + + IF (TRIM(filterstr) == '3DVAR') THEN + CALL PDAF_assimilate_hyb3dvar_lestkf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, & + prodRinvA_pdafomi, cvt_ens_pdaf, cvt_adj_ens_pdaf, cvt_pdaf, cvt_adj_pdaf, & + obs_op_lin_pdafomi, obs_op_adj_pdafomi, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, & + prodRinvA_l_pdafomi, init_n_domains_pdaf, init_dim_l_pdaf, & + init_dim_obs_l_pdafomi, g2l_state_pdaf, l2g_state_pdaf, PDAFomi_g2l_obs_cb, & + PDAFomi_init_obsvar_cb, PDAFomi_init_obsvar_l_cb, & + prepoststep_pdaf, next_observation_pdaf, outflag) + ELSE + WRITE (*,*) 'PDAF-ERROR: No valid filter type for PDAFomi_assimilate_hyb3dvar_lestkf_nondiagR' + outflag = 200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_assimilate_hyb3dvar_lestkf_nondiagR -- END' + +END SUBROUTINE PDAFomi_assimilate_hyb3dvar_lestkf_nondiagR diff --git a/src/PDAFomi_assimilate_lenkf_nondiagR.F90 b/src/PDAFomi_assimilate_lenkf_nondiagR.F90 new file mode 100644 index 000000000..a832a8b40 --- /dev/null +++ b/src/PDAFomi_assimilate_lenkf_nondiagR.F90 @@ -0,0 +1,97 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_assimilate_lenkf_nondiagR --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFomi_assimilate_lenkf_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, localize_covar_pdafomi, & + add_obs_error_pdafomi, init_obscovar_pdafomi, next_observation_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! Variant for LENKF with domain decomposition. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of observation vector + obs_op_pdafomi, & ! Observation operator + localize_covar_pdafomi, & ! Apply localization to HP and HPH^T + init_obscovar_pdafomi, & ! Initialize mean observation error variance + add_obs_error_pdafomi ! Provide product R^-1 A + EXTERNAL :: PDAFomi_init_obs_f_cb ! Initialize observation vector + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAF_assimilate_lenkf +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_assimilate_lenkf_nondiagR -- START' + + CALL PDAF_assimilate_lenkf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, prepoststep_pdaf, & + localize_covar_pdafomi, add_obs_error_pdafomi, init_obscovar_pdafomi, & + next_observation_pdaf, outflag) + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_assimilate_lenkf_nondiagR -- END' + +END SUBROUTINE PDAFomi_assimilate_lenkf_nondiagR diff --git a/src/PDAFomi_assimilate_lenkf_nondiagR_si.F90 b/src/PDAFomi_assimilate_lenkf_nondiagR_si.F90 new file mode 100644 index 000000000..dd3904a2d --- /dev/null +++ b/src/PDAFomi_assimilate_lenkf_nondiagR_si.F90 @@ -0,0 +1,78 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_assimilate_lenkf_nondiagR_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFomi_assimilate_lenkf_nondiagR_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + ! Interface to PDAF-OMI for local and global filters + EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain + obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain + localize_covar_pdafomi, & ! Apply localization to HP and HPH^T + init_obscovar_pdafomi, & ! Initialize mean observation error variance + add_obs_error_pdafomi ! Provide product R^-1 A + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFomi_assimilate_lenkf_nondiagR +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFomi_assimilate_lenkf_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, localize_covar_pdafomi, & + add_obs_error_pdafomi, init_obscovar_pdafomi, next_observation_pdaf, outflag) + +END SUBROUTINE PDAFomi_assimilate_lenkf_nondiagR_si diff --git a/src/PDAFomi_assimilate_lknetf_nondiagR.F90 b/src/PDAFomi_assimilate_lknetf_nondiagR.F90 new file mode 100644 index 000000000..67a1600c4 --- /dev/null +++ b/src/PDAFomi_assimilate_lknetf_nondiagR.F90 @@ -0,0 +1,117 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_assimilate_lknetf_nondiagR --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFomi_assimilate_lknetf_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, prodRinvA_l_pdafomi, prodRinvA_hyb_l_pdafomi, & + likelihood_l_pdafomi, likelihood_hyb_l_pdafomi, g2l_state_pdaf, l2g_state_pdaf, & + next_observation_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all domain-localized filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + g2l_state_pdaf, & ! Get state on local ana. domain from full state + l2g_state_pdaf ! Init full state from local state + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of full observation vector + obs_op_pdafomi, & ! Full observation operator + init_dim_obs_l_pdafomi, & ! Initialize local dimimension of obs. vector + prodRinvA_l_pdafomi, & ! Provide product R^-1 A on local analysis domain + likelihood_l_pdafomi, & ! Compute likelihood and apply localization + prodRinvA_hyb_l_pdafomi, & ! Product R^-1 A on local analysis domain with hybrid weight + likelihood_hyb_l_pdafomi ! Compute likelihood and apply localization with tempering + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize full observation vector + PDAFomi_init_obs_l_cb, & ! Initialize local observation vector + PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance + PDAFomi_init_obsvar_l_cb, & ! Initialize local mean observation error variance + PDAFomi_g2l_obs_cb ! Restrict full obs. vector to local analysis domain + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_assimilate_lknetf_nondiagR -- START' + + IF (TRIM(filterstr) == 'LKNETF') THEN + CALL PDAF_assimilate_lknetf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, & + PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, prepoststep_pdaf, & + prodRinvA_l_pdafomi, prodRinvA_hyb_l_pdafomi, & + init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdafomi, & + g2l_state_pdaf, l2g_state_pdaf, PDAFomi_g2l_obs_cb, PDAFomi_init_obsvar_cb, & + PDAFomi_init_obsvar_l_cb, likelihood_l_pdafomi, likelihood_hyb_l_pdafomi, & + next_observation_pdaf, outflag) + ELSE + WRITE (*,*) 'PDAF-ERROR: Invalid filter choice for PDAFomi_assimilate_lknetf_nondiagR' + outflag=200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_assimilate_lknetf_nondiagR -- END' + +END SUBROUTINE PDAFomi_assimilate_lknetf_nondiagR diff --git a/src/PDAFomi_assimilate_lknetf_nondiagR_si.F90 b/src/PDAFomi_assimilate_lknetf_nondiagR_si.F90 new file mode 100644 index 000000000..0c257e900 --- /dev/null +++ b/src/PDAFomi_assimilate_lknetf_nondiagR_si.F90 @@ -0,0 +1,86 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_assimilate_lknetf_nondiagR_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFomi_assimilate_lknetf_nondiagR_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all domain-localized filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + g2l_state_pdaf, & ! Get state on local ana. domain from full state + l2g_state_pdaf ! Init full state from local state + EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain + obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain + init_dim_obs_l_pdafomi, & ! Get dimension of obs. vector for local analysis domain + prodRinvA_l_pdafomi, & ! Provide product R^-1 A on local analysis domain + prodRinvA_hyb_l_pdafomi, & ! Provide product R^-1 A on local analysis domain with hybrid weight + likelihood_l_pdafomi, & ! Compute observation likelihood for an ensemble member + likelihood_hyb_l_pdafomi ! Compute observation likelihood for an ensemble member with hybrid weight + + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFomi_assimilate_lknetf_nondiagR +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFomi_assimilate_lknetf_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, prodRinvA_l_pdafomi, prodRinvA_hyb_l_pdafomi, & + likelihood_l_pdafomi, likelihood_hyb_l_pdafomi, g2l_state_pdaf, l2g_state_pdaf, & + next_observation_pdaf, outflag) + +END SUBROUTINE PDAFomi_assimilate_lknetf_nondiagR_si diff --git a/src/PDAFomi_assimilate_lnetf_nondiagR.F90 b/src/PDAFomi_assimilate_lnetf_nondiagR.F90 new file mode 100644 index 000000000..aef0873ee --- /dev/null +++ b/src/PDAFomi_assimilate_lnetf_nondiagR.F90 @@ -0,0 +1,110 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_assimilate_lnetf_nondiagR --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFomi_assimilate_lnetf_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, likelihood_l_pdafomi, g2l_state_pdaf, l2g_state_pdaf, & + next_observation_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all domain-localized filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + g2l_state_pdaf, & ! Get state on local ana. domain from full state + l2g_state_pdaf ! Init full state from local state + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of full observation vector + obs_op_pdafomi, & ! Full observation operator + init_dim_obs_l_pdafomi, & ! Initialize local dimimension of obs. vector + likelihood_l_pdafomi ! Compute likelihood and apply localization + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize full observation vector + PDAFomi_init_obs_l_cb, & ! Initialize local observation vector + PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance + PDAFomi_init_obsvar_l_cb, & ! Initialize local mean observation error variance + PDAFomi_g2l_obs_cb ! Restrict full obs. vector to local analysis domain + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_assimilate_lnetf_nondiagR -- START' + + IF (TRIM(filterstr) == 'LNETF') THEN + CALL PDAF_assimilate_lnetf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_l_cb, & + prepoststep_pdaf, likelihood_l_pdafomi, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, g2l_state_pdaf, l2g_state_pdaf, & + PDAFomi_g2l_obs_cb, next_observation_pdaf, outflag) + ELSE + WRITE (*,*) 'PDAF-ERROR: Invalid filter choice for PDAFomi_assimilate_lnetf_nondiagR' + outflag=200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_assimilate_lnetf_nondiagR -- END' + +END SUBROUTINE PDAFomi_assimilate_lnetf_nondiagR diff --git a/src/PDAFomi_assimilate_lnetf_nondiagR_si.F90 b/src/PDAFomi_assimilate_lnetf_nondiagR_si.F90 new file mode 100644 index 000000000..da7542d82 --- /dev/null +++ b/src/PDAFomi_assimilate_lnetf_nondiagR_si.F90 @@ -0,0 +1,83 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_assimilate_lnetf_nondiagR_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFomi_assimilate_lnetf_nondiagR_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all domain-localized filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + g2l_state_pdaf, & ! Get state on local ana. domain from full state + l2g_state_pdaf ! Init full state from local state + EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain + obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain + init_dim_obs_l_pdafomi, & ! Get dimension of obs. vector for local analysis domain + likelihood_l_pdafomi ! Compute likelihood and apply localization + + + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFomi_assimilate_lnetf_nondiagR +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFomi_assimilate_lnetf_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, likelihood_l_pdafomi, g2l_state_pdaf, l2g_state_pdaf, & + next_observation_pdaf, outflag) + +END SUBROUTINE PDAFomi_assimilate_lnetf_nondiagR_si diff --git a/src/PDAFomi_assimilate_local_nondiagR.F90 b/src/PDAFomi_assimilate_local_nondiagR.F90 new file mode 100644 index 000000000..8991272f3 --- /dev/null +++ b/src/PDAFomi_assimilate_local_nondiagR.F90 @@ -0,0 +1,131 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_assimilate_local_nondiagR --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFomi_assimilate_local_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, prodRinvA_l_pdafomi, & + g2l_state_pdaf, l2g_state_pdaf, next_observation_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all domain-localized filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-07 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + g2l_state_pdaf, & ! Get state on local ana. domain from full state + l2g_state_pdaf ! Init full state from local state + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of full observation vector + obs_op_pdafomi, & ! Full observation operator + init_dim_obs_l_pdafomi, & ! Initialize local dimimension of obs. vector + prodRinvA_l_pdafomi ! Provide product of inverse of R with matrix A + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize full observation vector + PDAFomi_init_obs_l_cb, & ! Initialize local observation vector + PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance + PDAFomi_init_obsvar_l_cb, & ! Initialize local mean observation error variance + PDAFomi_g2l_obs_cb ! Restrict full obs. vector to local analysis domain + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_assimilate_local_nondiagR -- START' + + IF (TRIM(filterstr) == 'LSEIK') THEN + CALL PDAF_assimilate_lseik(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, & + prepoststep_pdaf, prodRinvA_l_pdafomi, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, g2l_state_pdaf, l2g_state_pdaf, & + PDAFomi_g2l_obs_cb, PDAFomi_init_obsvar_cb, PDAFomi_init_obsvar_l_cb, & + next_observation_pdaf, outflag) + ELSE IF (TRIM(filterstr) == 'LETKF') THEN + CALL PDAF_assimilate_letkf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, & + prepoststep_pdaf, prodRinvA_l_pdafomi, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, g2l_state_pdaf, l2g_state_pdaf, & + PDAFomi_g2l_obs_cb, PDAFomi_init_obsvar_cb, PDAFomi_init_obsvar_l_cb, & + next_observation_pdaf, outflag) + ELSE IF (TRIM(filterstr) == 'LESTKF') THEN + CALL PDAF_assimilate_lestkf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, & + prepoststep_pdaf, prodRinvA_l_pdafomi, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, g2l_state_pdaf, l2g_state_pdaf, & + PDAFomi_g2l_obs_cb, PDAFomi_init_obsvar_cb, PDAFomi_init_obsvar_l_cb, & + next_observation_pdaf, outflag) + ELSE IF (TRIM(filterstr) == 'LNETF') THEN + WRITE (*,*) 'PDAF-ERROR: Use PDAFomi_assimilate_lnetf_nondiagR for LNETF' + outflag=200 + ELSE IF (TRIM(filterstr) == 'LKNETF') THEN + WRITE (*,*) 'PDAF-ERROR: Use PDAFomi_assimilate_lknetf_nondiagR for LKNETF' + outflag=200 + ELSE + WRITE (*,*) 'PDAF-ERROR: Invalid filter choice for PDAFomi_assimilate_local_nondiagR' + outflag=200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_assimilate_local_nondiagR -- END' + +END SUBROUTINE PDAFomi_assimilate_local_nondiagR diff --git a/src/PDAFomi_assimilate_local_nondiagR_si.F90 b/src/PDAFomi_assimilate_local_nondiagR_si.F90 new file mode 100644 index 000000000..41ba74d09 --- /dev/null +++ b/src/PDAFomi_assimilate_local_nondiagR_si.F90 @@ -0,0 +1,82 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_assimilate_local_nondiagR_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFomi_assimilate_local_nondiagR_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all domain-localized filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-07 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + g2l_state_pdaf, & ! Get state on local ana. domain from full state + l2g_state_pdaf ! Init full state from local state + EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain + obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain + init_dim_obs_l_pdafomi, & ! Get dimension of obs. vector for local analysis domain + prodRinvA_l_pdafomi ! Provide product of inverse of R with matrix A + + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFomi_assimilate_local_nondiagR +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFomi_assimilate_local_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, prodRinvA_l_pdafomi, & + g2l_state_pdaf, l2g_state_pdaf, next_observation_pdaf, outflag) + +END SUBROUTINE PDAFomi_assimilate_local_nondiagR_si diff --git a/src/PDAFomi_assimilate_nonlin_nondiagR.F90 b/src/PDAFomi_assimilate_nonlin_nondiagR.F90 new file mode 100644 index 000000000..08e968a68 --- /dev/null +++ b/src/PDAFomi_assimilate_nonlin_nondiagR.F90 @@ -0,0 +1,105 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_assimilate_nonlin_nondiagR --- Interface to PDAF for global filters +! +! !INTERFACE: +SUBROUTINE PDAFomi_assimilate_nonlin_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, likelihood_pdafomi, prepoststep_pdaf, & + next_observation_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of observation vector + obs_op_pdafomi, & ! Observation operator + likelihood_pdafomi ! Compute likelihood + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector + PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance + PDAFomi_init_obscovar_cb, & ! Initialize mean observation error variance + PDAFomi_add_obs_error_cb ! Add observation error covariance matrix + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_assimilate_nonlin_nondiagR -- START' + + IF (TRIM(filterstr) == 'NETF') THEN + CALL PDAF_assimilate_netf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, prepoststep_pdaf, & + likelihood_pdafomi, next_observation_pdaf, outflag) + ELSEIF (TRIM(filterstr) == 'PF') THEN + CALL PDAF_assimilate_pf(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, prepoststep_pdaf, & + likelihood_pdafomi, next_observation_pdaf, outflag) + ELSE + WRITE (*,*) 'PDAF-ERROR: Invalid filter choice for PDAFomi_assimilate_nonlin_nondiagR' + outflag=200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_assimilate_nonlin_nondiagR -- END' + +END SUBROUTINE PDAFomi_assimilate_nonlin_nondiagR diff --git a/src/PDAFomi_assimilate_nonlin_nondiagR_si.F90 b/src/PDAFomi_assimilate_nonlin_nondiagR_si.F90 new file mode 100644 index 000000000..b52707301 --- /dev/null +++ b/src/PDAFomi_assimilate_nonlin_nondiagR_si.F90 @@ -0,0 +1,76 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_assimilate_nonlin_nondiagR_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFomi_assimilate_nonlin_nondiagR_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + distribute_state_pdaf, & ! Routine to distribute a state vector + next_observation_pdaf, & ! Provide time step, time and dimension of next observation + prepoststep_pdaf ! User supplied pre/poststep routine + ! Interface to PDAF-OMI for local and global filters + EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain + obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain + likelihood_pdafomi ! Compute likelihood + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFomi_assimilate_nonlin_nondiagR +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFomi_assimilate_nonlin_nondiagR(collect_state_pdaf, distribute_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, likelihood_pdafomi, prepoststep_pdaf, & + next_observation_pdaf, outflag) + +END SUBROUTINE PDAFomi_assimilate_nonlin_nondiagR_si diff --git a/src/PDAFomi_dim_obs_l.F90 b/src/PDAFomi_dim_obs_l.F90 new file mode 100644 index 000000000..0d8ad25d7 --- /dev/null +++ b/src/PDAFomi_dim_obs_l.F90 @@ -0,0 +1,1733 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id: PDAFomi_obs_l.F90 1147 2023-03-12 16:14:34Z lnerger $ + +!> PDAF-OMI routines for determining local observations +!! +!! This module contains generic routines for several observation-related +!! operations for local filters. The routines are +!! +!! * PDAFomi_init_dim_obs_l \n +!! Initialize dimension of local obs. vetor and arrays for +!! local observations +!! * PDAFomi_init_dim_obs_l_iso \n +!! Initialize dimension of local obs. vetor and arrays for +!! local observations for isotropic localization +!! * PDAFomi_init_dim_obs_l_noniso \n +!! Initialize dimension of local obs. vetor and arrays for +!! local observations for nonisotropic localization +!! * PDAFomi_init_dim_obs_l_noniso_locweights \n +!! Initialize dimension of local obs. vetor and arrays for +!! local observations for nonisotropic localization +!! and different locweight for horizontal and vertical +!! * PDAFomi_check_dist2_loop \n +!! Compute and check distance for isotropic localization +!! * PDAFomi_check_dist2_noniso_loop \n +!! Compute and check distance for non-isotropic localization +!! * PDAFomi_set_localization \n +!! Store localization parameters in OMI (for isotropic localization) +!! * PDAFomi_set_localization_noniso \n +!! Store localization parameters in OMI (for non-isotropic localization) +!! * PDAFomi_set_dim_obs_l \n +!! Register local observation with OMI +!! * PDAFomi_store_obs_l_index \n +!! Store index, distance, cradius, and sradius of a local observation +!! * PDAFomi_store_obs_l_index_vdist \n +!! Store index, distance, cradius, sradius, and vertical distance of +!! a local observation for 2+1D factorized localization +!! +!! __Revision history:__ +!! * 2019-06 - Lars Nerger - Initial code +!! * Later revisions - see repository log +!! +MODULE PDAFomi_dim_obs_l + + USE PDAFomi_obs_f, ONLY: obs_f, r_earth, pi, debug, n_obstypes, error + USE PDAFomi_obs_l, ONLY: obs_l, obs_l_all, firstobs, offset_obs_l + USE PDAF_mod_filtermpi, ONLY: mype, npes_filter + + IMPLICIT NONE + SAVE + + INTERFACE PDAFomi_init_dim_obs_l + MODULE PROCEDURE PDAFomi_init_dim_obs_l_iso + MODULE PROCEDURE PDAFomi_init_dim_obs_l_noniso + MODULE PROCEDURE PDAFomi_init_dim_obs_l_noniso_locweights + END INTERFACE + +CONTAINS + +!------------------------------------------------------------------------------- +!> Set dimension of local obs. vector and local obs. arrays +!! +!! This routine sets the number of local observations for the +!! current observation type for the local analysis domain +!! with coordinates COORD_l and localization cut-off radius CRADIUS. +!! Further the routine initializes arrays for the index of a +!! local observation in the full observation vector and its +!! corresponding distance. +!! The operations are performed by calling the routine +!! PDAFomi_check_dist2_loop once for counting and a second time +!! for initializing the arrays. +!! +!! __Revision history:__ +!! * 2019-06 - Lars Nerger - Initial code from restructuring observation routines +!! * Later revisions - see repository log +!! + SUBROUTINE PDAFomi_init_dim_obs_l_iso(thisobs_l, thisobs, coords_l, locweight, cradius, & + sradius, cnt_obs_l_all) + + IMPLICIT NONE + +! *** Arguments *** + TYPE(obs_f), INTENT(inout) :: thisobs !< Data type with full observation + TYPE(obs_l), TARGET, INTENT(inout) :: thisobs_l !< Data type with local observation + REAL, INTENT(in) :: coords_l(:) !< Coordinates of current analysis domain + INTEGER, INTENT(in) :: locweight !< Type of localization function + REAL, INTENT(in) :: cradius !< Localization cut-off radius + REAL, INTENT(in) :: sradius !< Support radius of localization function + INTEGER, INTENT(inout) :: cnt_obs_l_all !< Local dimension of current observation vector + +! *** Local variables *** + REAL :: maxcoords_l, mincoords_l ! Min/Max domain coordinates to check geographic coords + REAL :: maxocoords_l, minocoords_l ! Min/Max observation coordinates to check geographic coords + INTEGER :: cnt_obs ! Counter for valid local observations + + + doassim: IF (thisobs%doassim == 1) THEN + +! *********************************************** +! *** Check offset in full observation vector *** +! *********************************************** + + IF (debug>0) & + WRITE (*,*) '++ OMI-debug: ', debug, 'PDAFomi_init_dim_obs_l -- START' + + IF (thisobs%ncoord/=3 .AND. thisobs%disttype>=10) THEN + WRITE (*,*) '+++++ ERROR PDAF-OMI: factorized 2+1D localization can only be used for thisobs%ncoord=3' + error = 14 + END IF + + +! ************************************** +! *** Store localization information *** +! ************************************** + + thisobs_l%locweight = locweight + + ! Allocate vectors for localization radii and store their values + ! For isotropic localization the size of the arrays is just 1 + IF (ALLOCATED(thisobs_l%cradius)) DEALLOCATE(thisobs_l%cradius) + ALLOCATE(thisobs_l%cradius(1)) + IF (ALLOCATED(thisobs_l%sradius)) DEALLOCATE(thisobs_l%sradius) + ALLOCATE(thisobs_l%sradius(1)) + + thisobs_l%nradii = 1 + thisobs_l%cradius(1) = cradius + thisobs_l%sradius(1) = sradius + + +! ************************************** +! *** Count valid local observations *** +! ************************************** + + IF (debug>0) THEN + WRITE (*,*) '++ OMI-debug: ', debug, & + ' PDAFomi_init_dim_obs_l -- count local observations' + IF (thisobs%obsid == firstobs) THEN + WRITE (*,*) '++ OMI-debug init_dim_obs_l:', debug, ' Re-init dim_obs_l=0' + END IF + WRITE (*,*) '++ OMI-debug init_dim_obs_l:', debug, ' coords_l', coords_l + + ! For geographic coordinates check whether their range is reasonable + IF (thisobs%disttype==2 .OR. thisobs%disttype==3 .OR. thisobs%disttype==12 .OR. thisobs%disttype==13) THEN + maxcoords_l = MAXVAL(coords_l) + mincoords_l = MINVAL(coords_l) + maxocoords_l = MAXVAL(thisobs%ocoord_f(1:2, :)) + minocoords_l = MINVAL(thisobs%ocoord_f(1:2, :)) + + IF (maxcoords_l>2.0*pi .OR. mincoords_l<-pi .OR. maxocoords_l>2.0*pi .OR. minocoords_l<-pi) THEN + WRITE (*,*) '++ OMI-debug init_dim_obs_l:', debug, & + ' WARNING: The unit for geographic coordinates is radian, thus range (0,2*pi) or (-pi,pi)!' + END IF + END IF + WRITE (*,*) '++ OMI-debug init_dim_obs_l:', debug, & + ' Note: Please ensure that coords_l and observation coordinates have the same unit' + + WRITE (*,*) '++ OMI-debug init_dim_obs_l: ', debug, ' thisobs%ncoord', thisobs%ncoord + WRITE (*,*) '++ OMI-debug init_dim_obs_l: ', debug, ' thisobs_l%cradius', thisobs_l%cradius + WRITE (*,*) '++ OMI-debug init_dim_obs_l: ', debug, ' Check for observations within radius' + END IF + + cnt_obs = 0 + CALL PDAFomi_check_dist2_loop(thisobs_l, thisobs, coords_l, cnt_obs, 1) + + +! ************************************************ +! *** Initialize local observation for PDAFomi *** +! ************************************************ + + CALL PDAFomi_set_dim_obs_l(thisobs_l, thisobs, cnt_obs_l_all, cnt_obs) + + +! ************************************************************ +! *** Initialize internal local arrays for local distances *** +! *** and indices of local obs. in full obs. vector *** +! ************************************************************ + + IF (debug>0) & + WRITE (*,*) '++ OMI-debug: ', debug, & + ' PDAFomi_init_dim_obs_l -- initialize local observation arrays' + + ! Count local observations and initialize index and distance arrays + IF (thisobs_l%dim_obs_l>0) THEN + cnt_obs = 0 + CALL PDAFomi_check_dist2_loop(thisobs_l, thisobs, coords_l, cnt_obs, 2) + END IF + + ! Print debug information + IF (debug>0) THEN + WRITE (*,*) '++ OMI-debug init_dim_obs_l:', debug, ' thisobs_l%dim_obs_l', thisobs_l%dim_obs_l + IF (thisobs_l%dim_obs_l>0) THEN + WRITE (*,*) '++ OMI-debug init_dim_obs_l:', debug, ' thisobs_l%id_obs_l', thisobs_l%id_obs_l + WRITE (*,*) '++ OMI-debug init_dim_obs_l:', debug, ' thisobs_l%distance_l', thisobs_l%distance_l + END IF + WRITE (*,*) '++ OMI-debug: ', debug, 'PDAFomi_init_dim_obs_l -- END' + END IF + + END IF doassim + + END SUBROUTINE PDAFomi_init_dim_obs_l_iso + + +!------------------------------------------------------------------------------- +!> Check distance in case of isotropic localization +!! +!! This routine computes the distance between the location of +!! a local analysis domains and all full observations and checks +!! whether the observations lies within the localization radius. +!! The computation can be for Cartesian grids with and without +!! periodicity and for geographic coordinates. For Cartesian +!! grids, the coordinates can be in any unit, while geographic +!! coordinates must be provided in radians and the resulting +!! distance will be in meters. Finally, the routine checks +!! whether the distance is not larger than the cut-off radius. +!! +!! Choices for distance computation - disttype: +!! 0: Cartesian distance in ncoord dimensions +!! 1: Cartesian distance in ncoord dimensions with periodicity +!! (Needs specification of domsize(ncoord)) +!! 2: Aproximate geographic distance with horizontal coordinates in radians (-pi/+pi) +!! 3: Geographic distance computation using haversine formula +!! 10-13: Variants of distance types 0-3, but particularly for 3 dimensions in which +!! a 2+1 dimensional localization is applied (distance weighting only in the horizontal) +!! +!! __Revision history:__ +!! * 2024-04 - Lars Nerger - Initial code based on PDAFomi_comp_dist2 +!! * Later revisions - see repository log +!! + SUBROUTINE PDAFomi_check_dist2_loop(thisobs_l, thisobs, coordsA, cnt_obs, mode) + + IMPLICIT NONE + +! *** Arguments *** + TYPE(obs_l), INTENT(inout) :: thisobs_l !< Data type with local observation + TYPE(obs_f), INTENT(in) :: thisobs !< Data type with full observation + REAL, INTENT(in) :: coordsA(:) !< Coordinates of current analysis domain (ncoord) + INTEGER, INTENT(inout) :: cnt_obs !< Count number of local observations + INTEGER, INTENT(in) :: mode !< 1: count local observations + !< 2: initialize local arrays + +! *** Local variables *** + INTEGER :: i, k ! Counters + INTEGER :: verbose ! verbosity flag + INTEGER :: domsize ! Flag whether domainsize is set + LOGICAL :: distflag ! Flag whether distance in a coordinate direction is within cradius + REAL :: slon, slat ! sine of distance in longitude or latitude + REAL :: distance2 ! square distance + REAL :: cradius2 ! squared localization cut-off radius + REAL :: dists(thisobs%ncoord) ! Distance vector between analysis point and observation + REAL :: coordsB(thisobs%ncoord) ! Array for coordinates of a single observation + + +! ********************** +! *** Initialization *** +! ********************** + + scancount: DO i = 1, thisobs%dim_obs_f + + ! Initialize distance flag + distflag = .TRUE. + + verbose = i + + coordsB = thisobs%ocoord_f(1:thisobs%ncoord, i) + + +! ************************ +! *** Compute distance *** +! ************************ + + IF (.NOT.ALLOCATED(thisobs%domainsize)) THEN + domsize = 0 + ELSE + domsize = 1 + END IF + + norm: IF ((thisobs%disttype==0 .OR. thisobs%disttype==10) .OR. & + ((thisobs%disttype==1 .OR. thisobs%disttype==11) .AND. domsize==0)) THEN + + ! *** Compute Cartesian distance *** + + IF (debug>0 .AND. verbose==0) THEN + WRITE (*,*) '++ OMI-debug check_dist2: ', debug, ' compute Cartesian distance' + END IF + + IF (thisobs%ncoord>=3) THEN + dists(3) = ABS(coordsA(3) - coordsB(3)) + IF (dists(3)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + dists(2) = ABS(coordsA(2) - coordsB(2)) + IF (dists(2)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + dists(1) = ABS(coordsA(1) - coordsB(1)) + IF (dists(1)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + ! full squared distance + distance2 = 0.0 + IF (thisobs%disttype<10) THEN + ! full 3D localization + DO k = 1, thisobs%ncoord + distance2 = distance2 + dists(k)*dists(k) + END DO + ELSE + ! factorized 2+1D localization + DO k = 1, thisobs%ncoord-1 + distance2 = distance2 + dists(k)*dists(k) + END DO + END IF + END IF + END IF + END IF + ELSEIF (thisobs%ncoord==2) THEN + dists(2) = ABS(coordsA(2) - coordsB(2)) + IF (dists(2)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + dists(1) = ABS(coordsA(1) - coordsB(1)) + IF (dists(1)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + ! full squared distance + distance2 = 0.0 + DO k = 1, thisobs%ncoord + distance2 = distance2 + dists(k)*dists(k) + END DO + END IF + END IF + ELSEIF (thisobs%ncoord==1) THEN + dists(1) = ABS(coordsA(1) - coordsB(1)) + IF (dists(1)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + ! full squared distance + distance2 = 0.0 + DO k = 1, thisobs%ncoord + distance2 = distance2 + dists(k)*dists(k) + END DO + END IF + END IF + + ELSEIF ((thisobs%disttype==1 .OR. thisobs%disttype==11) .AND. domsize==1) THEN norm + + ! *** Compute periodic Cartesian distance *** + + IF (debug>0 .AND. verbose==0) THEN + WRITE (*,*) '++ OMI-debug check_dist2: ', debug, ' compute periodic Cartesian distance' + END IF + + IF (thisobs%ncoord>=3) THEN + IF (thisobs%domainsize(3)<=0.0) THEN + dists(3) = ABS(coordsA(3) - coordsB(3)) + ELSE + dists(3) = MIN(ABS(coordsA(3) - coordsB(3)), & + ABS(ABS(coordsA(3) - coordsB(3))-thisobs%domainsize(3))) + END IF + IF (dists(3)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + IF (thisobs%domainsize(2)<=0.0) THEN + dists(2) = ABS(coordsA(2) - coordsB(2)) + ELSE + dists(2) = MIN(ABS(coordsA(2) - coordsB(2)), & + ABS(ABS(coordsA(2) - coordsB(2))-thisobs%domainsize(2))) + END IF + IF (dists(2)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + IF (thisobs%domainsize(1)<=0.0) THEN + dists(1) = ABS(coordsA(1) - coordsB(1)) + ELSE + dists(1) = MIN(ABS(coordsA(1) - coordsB(1)), & + ABS(ABS(coordsA(1) - coordsB(1))-thisobs%domainsize(1))) + END IF + IF (dists(1)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + ! full squared distance + distance2 = 0.0 + IF (thisobs%disttype<10) THEN + ! full 3D localization + DO k = 1, thisobs%ncoord + distance2 = distance2 + dists(k)*dists(k) + END DO + ELSE + ! factorized 2+1D localization + DO k = 1, thisobs%ncoord-1 + distance2 = distance2 + dists(k)*dists(k) + END DO + END IF + END IF + END IF + END IF + ELSEIF (thisobs%ncoord==2) THEN + IF (thisobs%domainsize(2)<=0.0) THEN + dists(2) = ABS(coordsA(2) - coordsB(2)) + ELSE + dists(2) = MIN(ABS(coordsA(2) - coordsB(2)), & + ABS(ABS(coordsA(2) - coordsB(2))-thisobs%domainsize(2))) + END IF + IF (dists(2)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + IF (thisobs%domainsize(1)<=0.0) THEN + dists(1) = ABS(coordsA(1) - coordsB(1)) + ELSE + dists(1) = MIN(ABS(coordsA(1) - coordsB(1)), & + ABS(ABS(coordsA(1) - coordsB(1))-thisobs%domainsize(1))) + END IF + IF (dists(1)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + ! full squared distance + distance2 = 0.0 + DO k = 1, thisobs%ncoord + distance2 = distance2 + dists(k)*dists(k) + END DO + END IF + END IF + ELSEIF (thisobs%ncoord==1) THEN + IF (thisobs%domainsize(1)<=0.0) THEN + dists(1) = ABS(coordsA(1) - coordsB(1)) + ELSE + dists(1) = MIN(ABS(coordsA(1) - coordsB(1)), & + ABS(ABS(coordsA(1) - coordsB(1))-thisobs%domainsize(1))) + END IF + IF (dists(1)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + ! full squared distance + distance2 = 0.0 + DO k = 1, thisobs%ncoord + distance2 = distance2 + dists(k)*dists(k) + END DO + END IF + END IF + + ELSEIF (thisobs%disttype==2 .OR. thisobs%disttype==12) THEN norm + + ! *** Compute distance from geographic coordinates *** + + IF (debug>0 .AND. verbose==0) THEN + WRITE (*,*) '++ OMI-debug check_dist2: ', debug, ' compute geographic distance' + END IF + + IF (thisobs%ncoord==3) THEN + dists(3) = ABS(coordsA(3) - coordsB(3)) + IF (dists(3)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + dists(2) = r_earth * ABS(coordsA(2) - coordsB(2)) + IF (dists(2)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + dists(1) = r_earth * MIN( ABS(coordsA(1) - coordsB(1))* COS(coordsA(2)), & + ABS(ABS(coordsA(1) - coordsB(1)) - 2.0*pi) * COS(coordsA(2))) + IF (dists(1)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + ! full squared distance + distance2 = 0.0 + IF (thisobs%disttype<10) THEN + ! full 3D localization + DO k = 1, thisobs%ncoord + distance2 = distance2 + dists(k)*dists(k) + END DO + ELSE + ! factorized 2+1D localization + DO k = 1, thisobs%ncoord-1 + distance2 = distance2 + dists(k)*dists(k) + END DO + END IF + END IF + END IF + END IF + ELSE + dists(2) = r_earth * ABS(coordsA(2) - coordsB(2)) + IF (dists(2)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + dists(1) = r_earth * MIN( ABS(coordsA(1) - coordsB(1))* COS(coordsA(2)), & + ABS(ABS(coordsA(1) - coordsB(1)) - 2.0*pi) * COS(coordsA(2))) + IF (dists(1)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + ! full squared distance + distance2 = 0.0 + DO k = 1, thisobs%ncoord + distance2 = distance2 + dists(k)*dists(k) + END DO + END IF + END IF + END IF + + ELSEIF (thisobs%disttype==3 .OR. thisobs%disttype==13) THEN norm + + ! *** Compute distance from geographic coordinates with haversine formula *** + + IF (debug>0 .AND. verbose==0) THEN + WRITE (*,*) '++ OMI-debug check_dist2: ', debug, & + ' compute geographic distance using haversine function' + END IF + + IF (thisobs%ncoord==3) THEN + dists(3) = ABS(coordsA(3) - coordsB(3)) + IF (dists(3)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + dists(2) = r_earth * ABS(coordsA(2) - coordsB(2)) + IF (dists(2)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + ! Haversine formula + slon = SIN((coordsA(1) - coordsB(1))/2) + slat = SIN((coordsA(2) - coordsB(2))/2) + + dists(2) = SQRT(slat*slat + COS(coordsA(2))*COS(coordsB(2))*slon*slon) + IF (dists(2)<=1.0) THEN + dists(2) = 2.0 * r_earth* ASIN(dists(2)) + ELSE + dists(2) = r_earth* pi + END IF + IF (dists(2)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + ! full squared distance + distance2 = 0.0 + IF (thisobs%disttype<10) THEN + ! full 3D localization + DO k = 2, thisobs%ncoord + distance2 = distance2 + dists(k)*dists(k) + END DO + ELSE + ! factorized 2+1D localization + DO k = 2, thisobs%ncoord-1 + distance2 = distance2 + dists(k)*dists(k) + END DO + END IF + END IF + END IF + END IF + ELSE + dists(2) = r_earth * ABS(coordsA(2) - coordsB(2)) + IF (dists(2)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + ! Haversine formula + slon = SIN((coordsA(1) - coordsB(1))/2) + slat = SIN((coordsA(2) - coordsB(2))/2) + + dists(2) = SQRT(slat*slat + COS(coordsA(2))*COS(coordsB(2))*slon*slon) + IF (dists(2)<=1.0) THEN + dists(2) = 2.0 * r_earth* ASIN(dists(2)) + ELSE + dists(2) = r_earth* pi + END IF + IF (dists(2)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + ! full squared distance + distance2 = 0.0 + DO k = 1, thisobs%ncoord + distance2 = distance2 + dists(k)*dists(k) + END DO + END IF + END IF + END IF + + END IF norm + + IF (distflag) THEN + cradius2 = thisobs_l%cradius(1)*thisobs_l%cradius(1) + + IF (distance2 <= cradius2) THEN + + ! Increment counter + cnt_obs = cnt_obs + 1 + + IF (debug>0) THEN + WRITE (*,*) '++ OMI-debug cnt_dim_obs_l: ', debug, & + ' valid observation with coordinates', thisobs%ocoord_f(1:thisobs%ncoord, i) + END IF + + IF (mode == 2) THEN + ! For internal storage (use in prodRinvA_l) + thisobs_l%id_obs_l(cnt_obs) = i ! node index + thisobs_l%distance_l(cnt_obs) = SQRT(distance2) ! distance + thisobs_l%cradius_l(cnt_obs) = thisobs_l%cradius(1) ! isotropic cut-off radius + thisobs_l%sradius_l(cnt_obs) = thisobs_l%sradius(1) ! isotropic support radius + END IF + + END IF + END IF + END DO scancount + + END SUBROUTINE PDAFomi_check_dist2_loop + + + + +!------------------------------------------------------------------------------- +!> Set dimension of local obs. vector and local obs. arrays (non-isotropic) +!! +!! This routine sets the number of local observations for the +!! current observation type for the local analysis domain +!! with coordinates COORD_l and a vector of localization cut-off +!! radii CRADIUS. +!! Further the routine initializes arrays for the index of a +!! local observation in the full observation vector and its +!! corresponding distance. +!! The operation are performed by calling the routines +!! cnt_dim_obs_l and init_obsarrays_l. +!! +!! __Revision history:__ +!! * 2024-02 - Lars Nerger - Initial code from restructuring observation routines +!! * Later revisions - see repository log +!! + SUBROUTINE PDAFomi_init_dim_obs_l_noniso(thisobs_l, thisobs, coords_l, locweight, cradius, & + sradius, cnt_obs_l_all) + + IMPLICIT NONE + +! *** Arguments *** + TYPE(obs_f), INTENT(inout) :: thisobs !< Data type with full observation + TYPE(obs_l), TARGET, INTENT(inout) :: thisobs_l !< Data type with local observation + REAL, INTENT(in) :: coords_l(:) !< Coordinates of current analysis domain + INTEGER, INTENT(in) :: locweight !< Type of localization function + REAL, INTENT(in) :: cradius(:) !< Vector of localization cut-off radii + REAL, INTENT(in) :: sradius(:) !< Vector of support radii of localization function + INTEGER, INTENT(inout) :: cnt_obs_l_all !< Local dimension of current observation vector + +! *** Local variables *** + REAL :: maxcoords_l, mincoords_l ! Min/Max domain coordinates to check geographic coords + REAL :: maxocoords_l, minocoords_l ! Min/Max observation coordinates to check geographic coords + INTEGER :: cnt_obs ! Counter for valid local observations + + + doassim: IF (thisobs%doassim == 1) THEN + +! *********************************************** +! *** Check offset in full observation vector *** +! *********************************************** + + IF (debug>0) & + WRITE (*,*) '++ OMI-debug: ', debug, 'PDAFomi_init_dim_obs_l_noniso -- START' + + ! Check consistency of dimensions + IF (SIZE(cradius) /= thisobs%ncoord) THEN + WRITE (*,*) '+++++ ERROR PDAF-OMI: non-isotropic localization: Size of CRADIUS /= thisobs%ncoord' + error = 12 + END IF + IF (SIZE(sradius) /= thisobs%ncoord) THEN + WRITE (*,*) '+++++ ERROR PDAF-OMI: non-isotropic localization: Size of SRADIUS /= thisobs%ncoord' + error = 13 + END IF + IF (thisobs%ncoord/=3 .AND. thisobs%disttype>=10) THEN + WRITE (*,*) '+++++ ERROR PDAF-OMI: factorized 2+1D localization can only be used for thisobs%ncoord=3' + error = 14 + END IF + + +! ************************************** +! *** Store localization information *** +! ************************************** + + thisobs_l%locweight = locweight + + ! Allocate vectors for localization radii and store their values + IF (ALLOCATED(thisobs_l%cradius)) DEALLOCATE(thisobs_l%cradius) + ALLOCATE(thisobs_l%cradius(thisobs%ncoord)) + IF (ALLOCATED(thisobs_l%sradius)) DEALLOCATE(thisobs_l%sradius) + ALLOCATE(thisobs_l%sradius(thisobs%ncoord)) + + thisobs_l%nradii = thisobs%ncoord + thisobs_l%cradius(:) = cradius(:) + thisobs_l%sradius(:) = sradius(:) + + +! ************************************** +! *** Count valid local observations *** +! ************************************** + + IF (debug>0) THEN + WRITE (*,*) '++ OMI-debug: ', debug, & + ' PDAFomi_init_dim_obs_l_noniso -- count local observations' + IF (thisobs%obsid == firstobs) THEN + WRITE (*,*) '++ OMI-debug init_dim_obs_l_noniso:', debug, ' Re-init dim_obs_l=0' + END IF + WRITE (*,*) '++ OMI-debug init_dim_obs_l_noniso:', debug, ' coords_l', coords_l + + ! For geographic coordinates check whether their range is reasonable + IF (thisobs%disttype==2 .OR. thisobs%disttype==3 .OR. thisobs%disttype==12 .OR. thisobs%disttype==13) THEN + maxcoords_l = MAXVAL(coords_l) + mincoords_l = MINVAL(coords_l) + maxocoords_l = MAXVAL(thisobs%ocoord_f(1:2, :)) + minocoords_l = MINVAL(thisobs%ocoord_f(1:2, :)) + + IF (maxcoords_l>2.0*pi .OR. mincoords_l<-pi .OR. maxocoords_l>2.0*pi .OR. minocoords_l<-pi) THEN + WRITE (*,*) '++ OMI-debug init_dim_obs_l_noniso:', debug, & + ' WARNING: The unit for geographic coordinates is radian, thus range (0,2*pi) or (-pi,pi)!' + END IF + END IF + WRITE (*,*) '++ OMI-debug init_dim_obs_l_noniso:', debug, & + ' Note: Please ensure that coords_l and observation coordinates have the same unit' + + WRITE (*,*) '++ OMI-debug init_dim_obs_l_noniso: ', debug, ' thisobs%ncoord', thisobs%ncoord + WRITE (*,*) '++ OMI-debug init_dim_obs_l_noniso: ', debug, ' thisobs_l%cradius', thisobs_l%cradius + WRITE (*,*) '++ OMI-debug init_dim_obs_l_noniso: ', debug, ' Check for observations within radius' + END IF + + cnt_obs = 0 + IF (thisobs_l%nradii==1) THEN + ! 1D but with radius specified as array + CALL PDAFomi_check_dist2_loop(thisobs_l, thisobs, coords_l, cnt_obs, 1) + ELSEIF (thisobs_l%nradii==2 .OR. thisobs_l%nradii==3) THEN + ! Nonisotropic in 2 or 3 dimensions + CALL PDAFomi_check_dist2_noniso_loop(thisobs_l, thisobs, coords_l, cnt_obs, 1) + ELSE + WRITE (*,*) '+++++ ERROR PDAF-OMI: nonisotropic localization is only possible in 1, 2 or 3 dimensions' + error = 10 + END IF + + +! ************************************************ +! *** Initialize local observation for PDAFomi *** +! ************************************************ + + CALL PDAFomi_set_dim_obs_l(thisobs_l, thisobs, cnt_obs_l_all, cnt_obs) + + +! ************************************************************ +! *** Initialize internal local arrays for local distances *** +! *** and indices of local obs. in full obs. vector *** +! ************************************************************ + + IF (debug>0) & + WRITE (*,*) '++ OMI-debug: ', debug, & + ' PDAFomi_init_dim_obs_l_noniso -- initialize local observation arrays' + + ! Count local observations and initialize index and distance arrays + IF (thisobs_l%dim_obs_l>0) THEN + + cnt_obs = 0 + IF (thisobs_l%nradii==1) THEN + ! 1D but with radius specified as array + CALL PDAFomi_check_dist2_loop(thisobs_l, thisobs, coords_l, cnt_obs, 2) + ELSEIF (thisobs_l%nradii==2 .OR. thisobs_l%nradii==3) THEN + ! Nonisotropic in 2 or 3 dimensions + CALL PDAFomi_check_dist2_noniso_loop(thisobs_l, thisobs, coords_l, cnt_obs, 2) + ELSE + WRITE (*,*) '+++++ ERROR PDAF-OMI: nonisotropic localization is only possible in 1, 2 or 3 dimensions' + error = 11 + END IF + END IF + + ! Print debug information + IF (debug>0) THEN + WRITE (*,*) '++ OMI-debug init_dim_obs_l_noniso:', debug, ' thisobs_l%dim_obs_l', thisobs_l%dim_obs_l + IF (thisobs_l%dim_obs_l>0) THEN + WRITE (*,*) '++ OMI-debug init_dim_obs_l_noniso:', debug, ' thisobs_l%id_obs_l', thisobs_l%id_obs_l + WRITE (*,*) '++ OMI-debug init_dim_obs_l_noniso:', debug, ' thisobs_l%distance_l', thisobs_l%distance_l + END IF + WRITE (*,*) '++ OMI-debug: ', debug, 'PDAFomi_init_dim_obs_l_noniso -- END' + END IF + + END IF doassim + + END SUBROUTINE PDAFomi_init_dim_obs_l_noniso + + + + +!------------------------------------------------------------------------------- +!> Set dimension of local obs. vector and local obs. arrays +!! +!! This routine is a variant of PDAFomi_init_dim_obs_l_noniso with +!! support for a vector of localization weights. This is used +!! to specify different localization functions for the vertical and +!! horizontal directions. The routine only stores the value of +!! locweights(2) for the vertical and calls PDAFomi_init_dim_obs_l_iso. +!! +!! __Revision history:__ +!! * 2024-04 - Lars Nerger - Initial code +!! * Later revisions - see repository log +!! + SUBROUTINE PDAFomi_init_dim_obs_l_noniso_locweights(thisobs_l, thisobs, coords_l, locweights, cradius, & + sradius, cnt_obs_l) + + IMPLICIT NONE + +! *** Arguments *** + TYPE(obs_f), INTENT(inout) :: thisobs !< Data type with full observation + TYPE(obs_l), TARGET, INTENT(inout) :: thisobs_l !< Data type with local observation + REAL, INTENT(in) :: coords_l(:) !< Coordinates of current analysis domain + INTEGER, INTENT(in) :: locweights(:) !< Types of localization function + REAL, INTENT(in) :: cradius(:) !< Vector of localization cut-off radii + REAL, INTENT(in) :: sradius(:) !< Vector of support radii of localization function + INTEGER, INTENT(inout) :: cnt_obs_l !< Local dimension of current observation vector + + +! *** Store vertical locweight and call standard routine + + IF (debug>0) THEN + WRITE (*,*) '++ OMI-debug: ', debug, 'PDAFomi_init_dim_obs_l_noniso_locweights -- START' + WRITE (*,*) '++ OMI-debug init_dim_obs_l_noniso_locweights:', debug, ' locweights', locweights + END IF + + ! Check consistency of dimensions + IF (SIZE(locweights) /= 2) THEN + WRITE (*,*) '+++++ ERROR PDAF-OMI: Input for locweight in horizontal and vertical directions needs size 2' + error = 15 + END IF + IF (thisobs%ncoord /= 3) THEN + WRITE (*,*) '+++++ WARNING PDAF-OMI: separate locweight for vertical is only utilized if thisobs%ncoord=3' + END IF + + IF (thisobs%ncoord == 3) THEN + ! locweight for the vertical is treated separately + thisobs_l%locweight_v = locweights(2) + END IF + + ! Call to usual routine that handles a single locweight setting + CALL PDAFomi_init_dim_obs_l_noniso(thisobs_l, thisobs, coords_l, locweights(1), cradius, & + sradius, cnt_obs_l) + + IF (debug>0) & + WRITE (*,*) '++ OMI-debug: ', debug, 'PDAFomi_init_dim_obs_l_noniso_locweights -- END' + + END SUBROUTINE PDAFomi_init_dim_obs_l_noniso_locweights + + +!------------------------------------------------------------------------------- +!> Check distance in case of nonisotropic localization +!! +!! This routine computes the distance between the observation and a +!! model grid point and the cut-off radius of an ellipse (in 2D) +!! or ellipsoid (in 3D) in the direction of the distance. Finally, +!! the routine checks whether the distance is not larger than the +!! cut-off radius. +!! +!! Choices for distance computation - disttype: +!! 0: Cartesian distance in ncoord dimensions +!! 1: Cartesian distance in ncoord dimensions with periodicity +!! (Needs specification of domsize(ncoord)) +!! 2: Aproximate geographic distance with horizontal coordinates in radians (-pi/+pi) +!! 3: Geographic distance computation using haversine formula +!! 10-13: Variants of distance types 0-3, but particularly for 3 dimensions in which +!! a 2+1 dimensional localization is applied (distance weighting only in the horizontal) +!! +!! __Revision history:__ +!! * 2024-02 - Lars Nerger - Initial code +!! * Later revisions - see repository log +!! + SUBROUTINE PDAFomi_check_dist2_noniso_loop(thisobs_l, thisobs, coordsA, cnt_obs, mode) + + IMPLICIT NONE + +! *** Arguments *** + TYPE(obs_f), INTENT(in) :: thisobs !< Data type with full observation + TYPE(obs_l), INTENT(inout) :: thisobs_l !< Data type with local observation + REAL, INTENT(in) :: coordsA(:) !< Coordinates of current analysis domain (ncoord) + INTEGER, INTENT(inout) :: cnt_obs !< Count number of local observations + INTEGER, INTENT(in) :: mode !< 1: count local observations + !< 2: initialize local arrays + +! *** Local variables *** + INTEGER :: i, k ! Counters + INTEGER :: verbose ! verbosity flag + INTEGER :: domsize ! Flag whether domainsize is set + LOGICAL :: distflag ! Flag whether distance in a coordinate direction is within cradius + REAL :: slon, slat ! sine of distance in longitude or latitude + REAL :: distance2 ! square distance + REAL :: cradius2 ! cut-off radius on ellipse or ellipsoid + REAL :: phi, theta ! Angles in ellipse or ellipsoid + REAL :: dist_xy ! Distance in xy-plan in 3D case + REAL :: dists(thisobs%ncoord) ! Distance vector between analysis point and observation + REAL :: coordsB(thisobs%ncoord) ! Array for coordinates of a single observation + REAL :: cradius ! Directional cut-off radius + REAL :: sradius ! Directional support radius + LOGICAL :: checkdist ! Flag whether distance is within cut-off radius + + +! ********************** +! *** Initialization *** +! ********************** + + scancount: DO i = 1, thisobs%dim_obs_f + + ! Initialize distance flag + checkdist = .FALSE. ! Whether an observation lies within the local box + distflag = .TRUE. ! Whether an observation lies within the local radius (ellipse, ellipsoid) + + ! Verbosity flag + verbose = i + + ! Observation coordinates + coordsB = thisobs%ocoord_f(1:thisobs%ncoord, i) + + +! ************************ +! *** Compute distance *** +! ************************ + + IF (.NOT.ALLOCATED(thisobs%domainsize)) THEN + domsize = 0 + ELSE + domsize = 1 + END IF + + ! Debug output + IF (debug>0 .AND. verbose==0) THEN + WRITE (*,*) '++ OMI-debug check_dist2_noniso: ', debug, ' use non-isotropic localization' + END IF + + norm: IF ((thisobs%disttype==0 .OR. thisobs%disttype==10) .OR. & + ((thisobs%disttype==1 .OR. thisobs%disttype==11) .AND. domsize==0)) THEN + + ! *** Compute Cartesian distance *** + + IF (debug>0 .AND. verbose==0) THEN + WRITE (*,*) '++ OMI-debug check_dist2_noniso: ', debug, ' compute Cartesian distance' + END IF + + IF (thisobs%ncoord==3) THEN + dists(3) = ABS(coordsA(3) - coordsB(3)) + IF (dists(3)>thisobs_l%cradius(3)) THEN + distflag = .FALSE. + ELSE + dists(2) = ABS(coordsA(2) - coordsB(2)) + IF (dists(2)>thisobs_l%cradius(2)) THEN + distflag = .FALSE. + ELSE + dists(1) = ABS(coordsA(1) - coordsB(1)) + IF (dists(1)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + ! full squared distance + distance2 = 0.0 + IF (thisobs%disttype<10) THEN + ! full 3D localization + DO k = 1, thisobs%ncoord + distance2 = distance2 + dists(k)*dists(k) + END DO + ELSE + ! factorized 2+1D localization + DO k = 1, thisobs%ncoord-1 + distance2 = distance2 + dists(k)*dists(k) + END DO + END IF + END IF + END IF + END IF + ELSEIF (thisobs%ncoord==2) THEN + dists(2) = ABS(coordsA(2) - coordsB(2)) + IF (dists(2)>thisobs_l%cradius(2)) THEN + distflag = .FALSE. + ELSE + dists(1) = ABS(coordsA(1) - coordsB(1)) + IF (dists(1)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + ! full squared distance + distance2 = 0.0 + DO k = 1, thisobs%ncoord + distance2 = distance2 + dists(k)*dists(k) + END DO + END IF + END IF + ELSEIF (thisobs%ncoord==1) THEN + dists(1) = ABS(coordsA(1) - coordsB(1)) + IF (dists(1)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + ! full squared distance + distance2 = 0.0 + DO k = 1, thisobs%ncoord + distance2 = distance2 + dists(k)*dists(k) + END DO + END IF + END IF + + ELSEIF ((thisobs%disttype==1 .OR. thisobs%disttype==11) .AND. domsize==1) THEN norm + + ! *** Compute periodic Cartesian distance *** + + IF (debug>0 .AND. verbose==0) THEN + WRITE (*,*) '++ OMI-debug check_dist2_noniso: ', debug, ' compute periodic Cartesian distance' + END IF + + IF (thisobs%ncoord==3) THEN + IF (thisobs%domainsize(3)<=0.0) THEN + dists(3) = ABS(coordsA(3) - coordsB(3)) + ELSE + dists(3) = MIN(ABS(coordsA(3) - coordsB(3)), & + ABS(ABS(coordsA(3) - coordsB(3))-thisobs%domainsize(3))) + END IF + IF (dists(3)>thisobs_l%cradius(3)) THEN + distflag = .FALSE. + ELSE + IF (thisobs%domainsize(2)<=0.0) THEN + dists(2) = ABS(coordsA(2) - coordsB(2)) + ELSE + dists(2) = MIN(ABS(coordsA(2) - coordsB(2)), & + ABS(ABS(coordsA(2) - coordsB(2))-thisobs%domainsize(2))) + END IF + IF (dists(2)>thisobs_l%cradius(2)) THEN + distflag = .FALSE. + ELSE + IF (thisobs%domainsize(1)<=0.0) THEN + dists(1) = ABS(coordsA(1) - coordsB(1)) + ELSE + dists(1) = MIN(ABS(coordsA(1) - coordsB(1)), & + ABS(ABS(coordsA(1) - coordsB(1))-thisobs%domainsize(1))) + END IF + IF (dists(1)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + ! full squared distance + distance2 = 0.0 + IF (thisobs%disttype<10) THEN + ! full 3D localization + DO k = 1, thisobs%ncoord + distance2 = distance2 + dists(k)*dists(k) + END DO + ELSE + ! factorized 2+1D localization + DO k = 1, thisobs%ncoord-1 + distance2 = distance2 + dists(k)*dists(k) + END DO + END IF + END IF + END IF + END IF + ELSEIF (thisobs%ncoord==2) THEN + IF (thisobs%domainsize(2)<=0.0) THEN + dists(2) = ABS(coordsA(2) - coordsB(2)) + ELSE + dists(2) = MIN(ABS(coordsA(2) - coordsB(2)), & + ABS(ABS(coordsA(2) - coordsB(2))-thisobs%domainsize(2))) + END IF + IF (dists(2)>thisobs_l%cradius(2)) THEN + distflag = .FALSE. + ELSE + IF (thisobs%domainsize(1)<=0.0) THEN + dists(1) = ABS(coordsA(1) - coordsB(1)) + ELSE + dists(1) = MIN(ABS(coordsA(1) - coordsB(1)), & + ABS(ABS(coordsA(1) - coordsB(1))-thisobs%domainsize(1))) + END IF + IF (dists(1)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + ! full squared distance + distance2 = 0.0 + DO k = 1, thisobs%ncoord + distance2 = distance2 + dists(k)*dists(k) + END DO + END IF + END IF + ELSEIF (thisobs%ncoord==1) THEN + IF (thisobs%domainsize(1)<=0.0) THEN + dists(1) = ABS(coordsA(1) - coordsB(1)) + ELSE + dists(1) = MIN(ABS(coordsA(1) - coordsB(1)), & + ABS(ABS(coordsA(1) - coordsB(1))-thisobs%domainsize(1))) + END IF + IF (dists(1)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + ! full squared distance + distance2 = 0.0 + DO k = 1, thisobs%ncoord + distance2 = distance2 + dists(k)*dists(k) + END DO + END IF + END IF + + ELSEIF (thisobs%disttype==2 .OR. thisobs%disttype==12) THEN norm + + ! *** Compute distance from geographic coordinates *** + + IF (debug>0 .AND. verbose==0) THEN + WRITE (*,*) '++ OMI-debug check_dist2_noniso: ', debug, ' compute geographic distance' + END IF + + IF (thisobs%ncoord==3) THEN + dists(3) = ABS(coordsA(3) - coordsB(3)) + IF (dists(3)>thisobs_l%cradius(3)) THEN + distflag = .FALSE. + ELSE + dists(2) = r_earth * ABS(coordsA(2) - coordsB(2)) + IF (dists(2)>thisobs_l%cradius(2)) THEN + distflag = .FALSE. + ELSE + dists(1) = r_earth * MIN( ABS(coordsA(1) - coordsB(1))* COS(coordsA(2)), & + ABS(ABS(coordsA(1) - coordsB(1)) - 2.0*pi) * COS(coordsA(2))) + IF (dists(1)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + ! full squared distance + distance2 = 0.0 + IF (thisobs%disttype<10) THEN + ! full 3D localization + DO k = 1, thisobs%ncoord + distance2 = distance2 + dists(k)*dists(k) + END DO + ELSE + ! factorized 2+1D localization + DO k = 1, thisobs%ncoord-1 + distance2 = distance2 + dists(k)*dists(k) + END DO + END IF + END IF + END IF + END IF + ELSE + dists(2) = r_earth * ABS(coordsA(2) - coordsB(2)) + IF (dists(2)>thisobs_l%cradius(2)) THEN + distflag = .FALSE. + ELSE + dists(1) = r_earth * MIN( ABS(coordsA(1) - coordsB(1))* COS(coordsA(2)), & + ABS(ABS(coordsA(1) - coordsB(1)) - 2.0*pi) * COS(coordsA(2))) + IF (dists(1)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + ! full squared distance + distance2 = 0.0 + DO k = 1, thisobs%ncoord + distance2 = distance2 + dists(k)*dists(k) + END DO + END IF + END IF + END IF + + ELSEIF (thisobs%disttype==3 .OR. thisobs%disttype==13) THEN norm + + ! *** Compute distance from geographic coordinates with haversine formula *** + + IF (debug>0 .AND. verbose==0) THEN + WRITE (*,*) '++ OMI-debug check_dist2_noniso: ', debug, & + ' compute geographic distance using haversine function' + END IF + + IF (thisobs%ncoord==3) THEN + dists(3) = ABS(coordsA(3) - coordsB(3)) + IF (dists(3)>thisobs_l%cradius(3)) THEN + distflag = .FALSE. + ELSE + dists(2) = r_earth * ABS(coordsA(2) - coordsB(2)) + IF (dists(2)>thisobs_l%cradius(2)) THEN + distflag = .FALSE. + ELSE + dists(1) = r_earth * MIN( ABS(coordsA(1) - coordsB(1))* COS(coordsA(2)), & + ABS(ABS(coordsA(1) - coordsB(1)) - 2.0*pi) * COS(coordsA(2))) + + ! Haversine formula + slon = SIN((coordsA(1) - coordsB(1))/2) + slat = SIN((coordsA(2) - coordsB(2))/2) + + dists(2) = SQRT(slat*slat + COS(coordsA(2))*COS(coordsB(2))*slon*slon) + IF (dists(2)<=1.0) THEN + dists(2) = 2.0 * r_earth* ASIN(dists(2)) + ELSE + dists(2) = r_earth* pi + END IF + IF (dists(2)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + ! full squared distance + distance2 = 0.0 + IF (thisobs%disttype<10) THEN + ! full 3D localization + DO k = 2, thisobs%ncoord + distance2 = distance2 + dists(k)*dists(k) + END DO + ELSE + ! factorized 2+1D localization + DO k = 2, thisobs%ncoord-1 + distance2 = distance2 + dists(k)*dists(k) + END DO + END IF + END IF + END IF + END IF + ELSE + dists(2) = r_earth * ABS(coordsA(2) - coordsB(2)) + IF (dists(2)>thisobs_l%cradius(2)) THEN + distflag = .FALSE. + ELSE + dists(1) = r_earth * MIN( ABS(coordsA(1) - coordsB(1))* COS(coordsA(2)), & + ABS(ABS(coordsA(1) - coordsB(1)) - 2.0*pi) * COS(coordsA(2))) + + ! Haversine formula + slon = SIN((coordsA(1) - coordsB(1))/2) + slat = SIN((coordsA(2) - coordsB(2))/2) + + dists(2) = SQRT(slat*slat + COS(coordsA(2))*COS(coordsB(2))*slon*slon) + IF (dists(2)<=1.0) THEN + dists(2) = 2.0 * r_earth* ASIN(dists(2)) + ELSE + dists(2) = r_earth* pi + END IF + IF (dists(2)>thisobs_l%cradius(1)) THEN + distflag = .FALSE. + ELSE + ! full squared distance + distance2 = 0.0 + DO k = 1, thisobs%ncoord + distance2 = distance2 + dists(k)*dists(k) + END DO + END IF + END IF + END IF + + END IF norm + + +! *************************************************************************** +! *** Compute directional cut-off and support radii and set distance flag *** +! *************************************************************************** + + dflag: IF (distflag) THEN + nrad: IF (thisobs_l%nradii == 2 .OR. (thisobs_l%nradii == 3 .AND. thisobs%disttype >= 10)) THEN + + IF ((thisobs_l%cradius(1) == thisobs_l%cradius(2)) .OR. & + (thisobs_l%sradius(1) == thisobs_l%sradius(2))) THEN + ! 2D isotropic case + + cradius2 = thisobs_l%cradius(1) * thisobs_l%cradius(1) + + IF (distance2 <= cradius2) THEN + ! Set flag for valid observation + checkdist = .TRUE. + cnt_obs = cnt_obs + 1 + + cradius = thisobs_l%cradius(1) + sradius = thisobs_l%sradius(1) + + IF (debug>0) THEN + WRITE (*,*) '++ OMI-debug check_dist2_noniso: ', debug, & + ' 2D isotropic with separately specified, but equal, radii' + WRITE (*,*) '++ OMI-debug check_dist2_noniso: ', debug, ' theta, cradius, sradius', & + theta*180/pi, cradius, sradius + END IF + END IF + ELSE + + ! *** 2D anisotropic case: Use polar radius of ellipse in 2 dimensions *** + + ! Compute angle + IF (dists(1) /= 0.0) THEN + theta = ATAN(dists(2) / dists(1)) + ELSE + theta = pi / 2.0 + END IF + + ! Compute radius in direction of theta + IF (thisobs_l%cradius(1)>0.0 .OR. thisobs_l%cradius(2)>0.0) THEN + cradius = thisobs_l%cradius(1) * thisobs_l%cradius(2) / & + SQRT( (thisobs_l%cradius(2)*COS(theta))**2 & + + (thisobs_l%cradius(1)*SIN(theta))**2 ) + ELSE + cradius = 0.0 + END IF + + cradius2 = cradius * cradius + + IF (distance2 <= cradius2) THEN + ! Set flag for valid observation + checkdist = .TRUE. + cnt_obs = cnt_obs + 1 + + ! Compute support radius in direction of theta + IF (thisobs_l%sradius(1)>0.0 .OR. thisobs_l%sradius(2)>0.0) THEN + sradius = thisobs_l%sradius(1) * thisobs_l%sradius(2) / & + SQRT( (thisobs_l%sradius(2)*COS(theta))**2 & + + (thisobs_l%sradius(1)*SIN(theta))**2 ) + ELSE + sradius = 0.0 + END IF + + IF (debug>0) THEN + WRITE (*,*) '++ OMI-debug check_dist2_noniso: ', debug, & + ' 2D nonisotropic localization' + WRITE (*,*) '++ OMI-debug check_dist2_noniso: ', debug, ' theta, cradius, sradius', & + theta*180/pi, cradius, sradius + END IF + END IF + + END IF + + ELSE IF (thisobs_l%nradii == 3 .AND. thisobs%disttype < 10) THEN nrad + + ! To save computing time, we here distinguish whether + ! - the horizontal radii are equal and only direction 3 has a different radius + ! - whether all radii are equal (isotropic but specified with separate radii) + ! - the anisotropy is in all 3 dimensions (all radii different) + + aniso: IF ((thisobs_l%cradius(1) == thisobs_l%cradius(2)) .AND. & + (thisobs_l%cradius(1) /= thisobs_l%cradius(3)) .AND. & + (thisobs_l%sradius(1) == thisobs_l%sradius(2))) THEN + + ! *** Isotropic in horizontal direction, distinct radius in the third direction (vertical) *** + + dist_xy = SQRT(dists(1)*dists(1) + dists(2)*dists(2)) + + ! 2D anisotropy: Polar radius of ellipse in 2 dimensions + + ! Compute angle + IF (dist_xy /= 0.0) THEN + theta = ATAN(dists(3) / dist_xy) + ELSE + theta = pi / 2.0 + END IF + + ! Compute radius in direction of theta + IF (thisobs_l%cradius(1)>0.0 .OR. thisobs_l%cradius(3)>0.0) THEN + cradius = thisobs_l%cradius(1) * thisobs_l%cradius(3) / & + SQRT( (thisobs_l%cradius(3)*COS(theta))**2 & + + (thisobs_l%cradius(1)*SIN(theta))**2 ) + ELSE + cradius = 0.0 + END IF + + cradius2 = cradius * cradius + + IF (distance2 <= cradius2) THEN + ! Set flag for valid observation + checkdist = .TRUE. + cnt_obs = cnt_obs + 1 + + ! Compute support radius in direction of theta + IF (thisobs_l%sradius(1)>0.0 .OR. thisobs_l%sradius(3)>0.0) THEN + sradius = thisobs_l%sradius(1) * thisobs_l%sradius(3) / & + SQRT( (thisobs_l%sradius(3)*COS(theta))**2 & + + (thisobs_l%sradius(1)*SIN(theta))**2 ) + ELSE + sradius = 0.0 + END IF + + IF (debug>0) THEN + WRITE (*,*) '++ OMI-debug check_dist2_noniso: ', debug, & + ' 3D: isotropic in directions 1 and 2, nonisotropic in direction 3' + WRITE (*,*) '++ OMI-debug check_dist2_noniso: ', debug, ' theta, cradius, sradius', & + theta*180/pi, cradius, sradius + END IF + END IF + + ELSEIF ((thisobs_l%cradius(1) == thisobs_l%cradius(2)) .AND. & + (thisobs_l%cradius(1) == thisobs_l%cradius(3)) .AND. & + (thisobs_l%sradius(1) == thisobs_l%sradius(2)) .AND. & + (thisobs_l%sradius(2) == thisobs_l%sradius(3))) THEN aniso + + ! *** 3D isotropic case (all radii equal) *** + + cradius = thisobs_l%cradius(1) + cradius2 = thisobs_l%cradius(1) * thisobs_l%cradius(1) + sradius = thisobs_l%sradius(1) + + IF (distance2 <= cradius2) THEN + ! Set flag for valid observation + checkdist = .TRUE. + cnt_obs = cnt_obs + 1 + END IF + + IF (debug>0) THEN + WRITE (*,*) '++ OMI-debug check_dist2_noniso: ', debug, & + ' 3D isotropic case specified with vector of radii' + WRITE (*,*) '++ OMI-debug check_dist2_noniso: ', debug, ' theta, cradius, sradius', & + theta*180/pi, cradius, sradius + END IF + ELSE aniso + + ! *** general 3D anisotropic case *** + + ! Polar radius of ellipsoid in 3 dimensions + + ! Compute angle in x-y direction + IF (dists(1) /= 0.0) THEN + theta = ATAN(dists(2) / dists(1)) + ELSE + theta = pi / 2.0 + END IF + + ! Distance in xy-plane + dist_xy = SQRT(dists(1)**2 + dists(2)**2) + + ! Compute angle of xy-plane to z direction + IF (dist_xy /= 0.0) THEN + phi = ATAN(dists(3) / dist_xy) + ELSE + phi = 0.0 + END IF + + ! Compute radius in direction of theta + IF (thisobs_l%cradius(1)>0.0 .OR. thisobs_l%cradius(2)>0.0 .OR. thisobs_l%cradius(3)>0.0) THEN + cradius = thisobs_l%cradius(1) * thisobs_l%cradius(2) * thisobs_l%cradius(3) / & + SQRT( (thisobs_l%cradius(2)*thisobs_l%cradius(3)*COS(phi)*COS(theta))**2 & + + (thisobs_l%cradius(1)*thisobs_l%cradius(3)*COS(phi)*SIN(theta))**2 & + + (thisobs_l%cradius(1)*thisobs_l%cradius(2)*SIN(phi))**2 ) + ELSE + cradius = 0.0 + END IF + + cradius2 = cradius * cradius + + IF (distance2 <= cradius2) THEN + ! Set flag for valid observation + checkdist = .TRUE. + cnt_obs = cnt_obs + 1 + + ! Compute support radius in direction of theta + IF (thisobs_l%sradius(1)>0.0 .OR. thisobs_l%sradius(2)>0.0 .OR. thisobs_l%sradius(3)>0.0) THEN + sradius = thisobs_l%sradius(1) * thisobs_l%sradius(2) * thisobs_l%sradius(3) / & + SQRT( (thisobs_l%sradius(2)*thisobs_l%sradius(3)*COS(phi)*COS(theta))**2 & + + (thisobs_l%sradius(1)*thisobs_l%sradius(3)*COS(phi)*SIN(theta))**2 & + + (thisobs_l%sradius(1)*thisobs_l%sradius(2)*SIN(phi))**2 ) + ELSE + sradius = 0.0 + END IF + + IF (debug>0) THEN + WRITE (*,*) '++ OMI-debug check_dist2_noniso: ', debug, & + ' 3D nonisotropic localization' + WRITE (*,*) '++ OMI-debug check_dist2_noniso: ', debug, ' theta, phi, distance, cradius, sradius', & + theta*180/pi, phi*180/pi, SQRT(distance2), cradius, sradius + END IF + END IF + + END IF aniso + ELSEIF (thisobs_l%nradii == 1) THEN nrad + cradius = thisobs_l%cradius(1) + cradius2 = thisobs_l%cradius(1) * thisobs_l%cradius(1) + sradius = thisobs_l%sradius(1) + + IF (distance2 <= cradius2) THEN + ! Set flag for valid observation + checkdist = .TRUE. + cnt_obs = cnt_obs + 1 + END IF + + END IF nrad + + IF (mode==2 .AND. checkdist) THEN + ! For internal storage (use in prodRinvA_l and likelihood_l) + thisobs_l%id_obs_l(cnt_obs) = i ! node index + thisobs_l%distance_l(cnt_obs) = SQRT(distance2) ! distance + thisobs_l%cradius_l(cnt_obs) = cradius ! directional cut-off radius + thisobs_l%sradius_l(cnt_obs) = sradius ! directional support radius + IF (thisobs_l%locweight_v>0 .AND. thisobs_l%nradii==3) THEN + thisobs_l%dist_l_v(cnt_obs) = dists(3) ! distance in vertical direction + END if + END IF + END IF dflag + + END DO scancount + + END SUBROUTINE PDAFomi_check_dist2_noniso_loop + + + +!------------------------------------------------------------------------------- +!> Set localization parameters for isotropic localization +!! +!! This routine stores localization information (locweight, cradius, sradius) +!! in OMI and allocates local arrays for cradius and sradius. This variant +!! is for isotropic localization. The routine is used by user-supplied +!! implementations of PDAFomi_init_dim_obs_l. +!! +!! The routine is called by all filter processes. +!! +!! __Revision history:__ +!! * 2024-09 - Lars Nerger - Initial code +!! * Later revisions - see repository log +!! + SUBROUTINE PDAFomi_set_localization(thisobs_l, cradius, sradius, locweight) + + IMPLICIT NONE + +! *** Arguments *** + TYPE(obs_l), INTENT(inout) :: thisobs_l !< Data type with local observation + REAL, INTENT(in) :: cradius !< Localization cut-off radius + REAL, INTENT(in) :: sradius !< Support radius of localization function + INTEGER, INTENT(in) :: locweight !< Type of localization function + + +! *** Allocate vectors for localization radii *** + + IF (ALLOCATED(thisobs_l%cradius)) DEALLOCATE(thisobs_l%cradius) + ALLOCATE(thisobs_l%cradius(1)) + IF (ALLOCATED(thisobs_l%sradius)) DEALLOCATE(thisobs_l%sradius) + ALLOCATE(thisobs_l%sradius(1)) + + thisobs_l%locweight = locweight + thisobs_l%nradii = 1 + thisobs_l%cradius(:) = cradius + thisobs_l%sradius(:) = sradius + + END SUBROUTINE PDAFomi_set_localization + + + +!------------------------------------------------------------------------------- +!> Set localization parameters for non-isotropic localization +!! +!! This routine stores localization information (locweight, cradius, sradius) +!! in OMI and allocates local arrays for cradius and sradius. This variant +!! is for non-isotropic localization. The routine is used by user-supplied +!! implementations of PDAFomi_init_dim_obs_l. +!! +!! The routine is called by all filter processes. +!! +!! __Revision history:__ +!! * 2024-09 - Lars Nerger - Initial code +!! * Later revisions - see repository log +!! + SUBROUTINE PDAFomi_set_localization_noniso(thisobs_l, nradii, cradius, sradius, locweight, locweight_v) + + IMPLICIT NONE + +! *** Arguments *** + TYPE(obs_l), INTENT(inout) :: thisobs_l !< Data type with local observation + INTEGER, INTENT(in) :: nradii !< Number of radii to consider for localization + REAL, INTENT(in) :: cradius(nradii) !< Localization cut-off radius + REAL, INTENT(in) :: sradius(nradii) !< Support radius of localization function + INTEGER, INTENT(in) :: locweight !< Type of localization function + INTEGER, INTENT(in) :: locweight_v !< Type of localization function in vertical direction (only for nradii=3) + + + +! *** Allocate vectors for localization radii *** + + IF (ALLOCATED(thisobs_l%cradius)) DEALLOCATE(thisobs_l%cradius) + ALLOCATE(thisobs_l%cradius(nradii)) + IF (ALLOCATED(thisobs_l%sradius)) DEALLOCATE(thisobs_l%sradius) + ALLOCATE(thisobs_l%sradius(nradii)) + + thisobs_l%locweight = locweight + thisobs_l%nradii = nradii + thisobs_l%cradius(1:nradii) = cradius(1:nradii) + thisobs_l%sradius(1:nradii) = sradius(1:nradii) + IF (nradii==3) thisobs_l%locweight_v = locweight_v + + END SUBROUTINE PDAFomi_set_localization_noniso + + +!------------------------------------------------------------------------------- +!> Initialization for dim_obs_l +!! +!! This routine initializes information on local observation vectors. +!! It is used by a user-supplied implementations of PDAFomi_init_dim_obs_l. +!! +!! The routine is called by all filter processes. +!! +!! __Revision history:__ +!! * 2024-08 - Lars Nerger - Initial code +!! * Later revisions - see repository log +!! + SUBROUTINE PDAFomi_set_dim_obs_l(thisobs_l, thisobs, cnt_obs_l_all, cnt_obs_l) + + IMPLICIT NONE + +! *** Arguments *** + TYPE(obs_f), INTENT(inout) :: thisobs !< Data type with full observation + TYPE(obs_l), TARGET, INTENT(inout) :: thisobs_l !< Data type with local observation + INTEGER, INTENT(inout) :: cnt_obs_l_all !< Local dimension of observation vector over all obs. types + INTEGER, INTENT(inout) :: cnt_obs_l !< Local dimension of single observation type vector + + + ! Store ID of first observation type that calls the routine + ! This is reset in PDAFomi_deallocate_obs + IF (firstobs == 0) THEN + firstobs = thisobs%obsid + END IF + + ! Reset offset of currrent observation in overall local obs. vector + IF (thisobs%obsid == firstobs) THEN + offset_obs_l = 0 + cnt_obs_l_all = 0 + END IF + + ! Store offset + thisobs_l%off_obs_l = offset_obs_l + + ! Initialize pointer array + IF (thisobs%obsid == firstobs) THEN + IF (ALLOCATED(obs_l_all)) DEALLOCATE(obs_l_all) + ALLOCATE(obs_l_all(n_obstypes)) + END IF + + ! Set pointer to current observation + obs_l_all(thisobs%obsid)%ptr => thisobs_l + + ! Store local observation dimension and increment offset + thisobs_l%dim_obs_l = cnt_obs_l + offset_obs_l = offset_obs_l + cnt_obs_l + cnt_obs_l_all = cnt_obs_l_all + cnt_obs_l + + ! Allocate arrays to store information on local observations + IF (ALLOCATED(thisobs_l%id_obs_l)) DEALLOCATE(thisobs_l%id_obs_l) + IF (ALLOCATED(thisobs_l%distance_l)) DEALLOCATE(thisobs_l%distance_l) + IF (ALLOCATED(thisobs_l%cradius_l)) DEALLOCATE(thisobs_l%cradius_l) + IF (ALLOCATED(thisobs_l%sradius_l)) DEALLOCATE(thisobs_l%sradius_l) + + haveobs: IF (cnt_obs_l>0) THEN + ALLOCATE(thisobs_l%id_obs_l(cnt_obs_l)) + ALLOCATE(thisobs_l%distance_l(cnt_obs_l)) + ALLOCATE(thisobs_l%cradius_l(cnt_obs_l)) + ALLOCATE(thisobs_l%sradius_l(cnt_obs_l)) + IF (thisobs_l%locweight_v>0) THEN + IF (ALLOCATED(thisobs_l%dist_l_v)) DEALLOCATE(thisobs_l%dist_l_v) + ALLOCATE(thisobs_l%dist_l_v(cnt_obs_l)) + END IF + + ELSE + ALLOCATE(thisobs_l%id_obs_l(1)) + ALLOCATE(thisobs_l%distance_l(1)) + ALLOCATE(thisobs_l%cradius_l(1)) + ALLOCATE(thisobs_l%sradius_l(1)) + IF (ALLOCATED(thisobs_l%dist_l_v)) DEALLOCATE(thisobs_l%dist_l_v) + ALLOCATE(thisobs_l%dist_l_v(1)) + END IF haveobs + + END SUBROUTINE PDAFomi_set_dim_obs_l + + + +!------------------------------------------------------------------------------- +!> Store local index, distance and radii +!! +!! This routine stores the mapping index between the global and local +!! observation vectors, the distance and the cradius and sradius +!! for a single observations in OMI. This variant is for non-factorized +!! localization. The routine is used by user-supplied implementations +!! of PDAFomi_init_dim_obs_l. +!! +!! The routine is called by all filter processes. +!! +!! __Revision history:__ +!! * 2024-09 - Lars Nerger - Initial code +!! * Later revisions - see repository log +!! + SUBROUTINE PDAFomi_store_obs_l_index(thisobs_l, idx, id_obs_l, distance, & + cradius_l, sradius_l) + + IMPLICIT NONE + +! *** Arguments *** + TYPE(obs_l), INTENT(inout) :: thisobs_l !< Data type with local observation + INTEGER, INTENT(in) :: idx !< Element of local observation array to be filled + INTEGER, INTENT(in) :: id_obs_l !< Index of local observation in full observation array + REAL, INTENT(in) :: distance !< Distance between local analysis domain and observation + REAL, INTENT(in) :: cradius_l !< cut-off radius for this local observation + ! (directional radius in case of non-isotropic localization) + REAL, INTENT(in) :: sradius_l !< support radius for this local observation + ! (directional radius in case of non-isotropic localization) + + +! *** Store values *** + + thisobs_l%id_obs_l(idx) = id_obs_l ! element of local obs. vector in full obs. vector + thisobs_l%distance_l(idx) = distance ! distance + thisobs_l%cradius_l(idx) = cradius_l ! cut-off radius + thisobs_l%sradius_l(idx) = sradius_l ! support radius + + + END SUBROUTINE PDAFomi_store_obs_l_index + + + +!------------------------------------------------------------------------------- +!> Store local index, dsitance and radii for factorized localization +!! +!! This routine stores the mapping index between the global and local +!! observation vectors, the distance and the cradius and sradius +!! for a single observations in OMI. This variant is for 2+1D factorized +!! localization. The routine is used by user-supplied implementations +!! of PDAFomi_init_dim_obs_l. +!! +!! The routine is called by all filter processes. +!! +!! __Revision history:__ +!! * 2024-09 - Lars Nerger - Initial code +!! * Later revisions - see repository log +!! + SUBROUTINE PDAFomi_store_obs_l_index_vdist(thisobs_l, idx, id_obs_l, distance, & + cradius_l, sradius_l, vdist) + + IMPLICIT NONE + +! *** Arguments *** + TYPE(obs_l), INTENT(inout) :: thisobs_l !< Data type with local observation + INTEGER, INTENT(in) :: idx !< Element of local observation array to be filled + INTEGER, INTENT(in) :: id_obs_l !< Index of local observation in full observation array + REAL, INTENT(in) :: distance !< Distance between local analysis domain and observation + REAL, INTENT(in) :: cradius_l !< cut-off radius for this local observation + ! (directional radius in case of non-isotropic localization) + REAL, INTENT(in) :: sradius_l !< support radius for this local observation + ! (directional radius in case of non-isotropic localization) + REAL, INTENT(in) :: vdist !< support radius in vertical direction for 2+1D factorized localization + + +! *** Store values *** + + thisobs_l%id_obs_l(idx) = id_obs_l ! element of local obs. vector in full obs. vector + thisobs_l%distance_l(idx) = distance ! distance + thisobs_l%cradius_l(idx) = cradius_l ! cut-off radius + thisobs_l%sradius_l(idx) = sradius_l ! support radius + IF (thisobs_l%locweight_v>0 .AND. thisobs_l%nradii==3) THEN + thisobs_l%dist_l_v(idx) = vdist ! distance in vertical direction + END if + + + END SUBROUTINE PDAFomi_store_obs_l_index_vdist + +END MODULE PDAFomi_dim_obs_l diff --git a/src/PDAFomi_obs_l.F90 b/src/PDAFomi_obs_l.F90 index b96f41345..e9f720fc3 100644 --- a/src/PDAFomi_obs_l.F90 +++ b/src/PDAFomi_obs_l.F90 @@ -24,17 +24,17 @@ !! !! * PDAFomi_set_debug_flag \n !! Set or unset the debugging flag for PDAFomi routines -!! * PDAFomi_init_dim_obs_l \n +!! * PDAFomi_init_dim_obs_l_old \n !! Initialize dimension of local obs. vetor and arrays for !! local observations -!! * PDAFomi_cnt_dim_obs_l \n +!! * PDAFomi_cnt_dim_obs_l_old \n !! Set dimension of local obs. vector with isotropic localization -!! * PDAFomi_cnt_dim_obs_l_noniso \n +!! * PDAFomi_cnt_dim_obs_l_noniso_old \n !! Set dimension of local obs. vector with nonisotropic localization -!! * PDAFomi_init_obsarrays_l \n +!! * PDAFomi_init_obsarrays_l_old \n !! Initialize arrays for the index of a local observation in !! the full observation vector and its corresponding distance. -!! * PDAFomi_init_obsarrays_l_noniso \n +!! * PDAFomi_init_obsarrays_l_noniso_old \n !! Initialize arrays for the index of a local observation in !! the full observation vector and its corresponding distance !! with onoisotrppic localization. @@ -123,10 +123,10 @@ MODULE PDAFomi_obs_l !$OMP THREADPRIVATE(obs_l_all, firstobs, offset_obs_l) - INTERFACE PDAFomi_init_dim_obs_l - MODULE PROCEDURE PDAFomi_init_dim_obs_l_iso - MODULE PROCEDURE PDAFomi_init_dim_obs_l_noniso - MODULE PROCEDURE PDAFomi_init_dim_obs_l_noniso_locweights + INTERFACE PDAFomi_init_dim_obs_l_old + MODULE PROCEDURE PDAFomi_init_dim_obs_l_iso_old + MODULE PROCEDURE PDAFomi_init_dim_obs_l_noniso_old + MODULE PROCEDURE PDAFomi_init_dim_obs_l_noniso_locweights_old END INTERFACE INTERFACE PDAFomi_localize_covar @@ -192,7 +192,7 @@ END SUBROUTINE PDAFomi_set_debug_flag !! * 2019-06 - Lars Nerger - Initial code from restructuring observation routines !! * Later revisions - see repository log !! - SUBROUTINE PDAFomi_init_dim_obs_l_iso(thisobs_l, thisobs, coords_l, locweight, cradius, & + SUBROUTINE PDAFomi_init_dim_obs_l_iso_old(thisobs_l, thisobs, coords_l, locweight, cradius, & sradius, cnt_obs_l) IMPLICIT NONE @@ -334,7 +334,7 @@ SUBROUTINE PDAFomi_init_dim_obs_l_iso(thisobs_l, thisobs, coords_l, locweight, c END IF doassim - END SUBROUTINE PDAFomi_init_dim_obs_l_iso + END SUBROUTINE PDAFomi_init_dim_obs_l_iso_old @@ -356,7 +356,7 @@ END SUBROUTINE PDAFomi_init_dim_obs_l_iso !! * 2024-02 - Lars Nerger - Initial code from restructuring observation routines !! * Later revisions - see repository log !! - SUBROUTINE PDAFomi_init_dim_obs_l_noniso(thisobs_l, thisobs, coords_l, locweight, cradius, & + SUBROUTINE PDAFomi_init_dim_obs_l_noniso_old(thisobs_l, thisobs, coords_l, locweight, cradius, & sradius, cnt_obs_l) IMPLICIT NONE @@ -507,7 +507,7 @@ SUBROUTINE PDAFomi_init_dim_obs_l_noniso(thisobs_l, thisobs, coords_l, locweight END IF doassim - END SUBROUTINE PDAFomi_init_dim_obs_l_noniso + END SUBROUTINE PDAFomi_init_dim_obs_l_noniso_old @@ -525,7 +525,7 @@ END SUBROUTINE PDAFomi_init_dim_obs_l_noniso !! * 2024-04 - Lars Nerger - Initial code !! * Later revisions - see repository log !! - SUBROUTINE PDAFomi_init_dim_obs_l_noniso_locweights(thisobs_l, thisobs, coords_l, locweights, cradius, & + SUBROUTINE PDAFomi_init_dim_obs_l_noniso_locweights_old(thisobs_l, thisobs, coords_l, locweights, cradius, & sradius, cnt_obs_l) IMPLICIT NONE @@ -562,13 +562,13 @@ SUBROUTINE PDAFomi_init_dim_obs_l_noniso_locweights(thisobs_l, thisobs, coords_l END IF ! Call to usual routine that handles a single locweight setting - CALL PDAFomi_init_dim_obs_l_noniso(thisobs_l, thisobs, coords_l, locweights(1), cradius, & + CALL PDAFomi_init_dim_obs_l_noniso_old(thisobs_l, thisobs, coords_l, locweights(1), cradius, & sradius, cnt_obs_l) IF (debug>0) & WRITE (*,*) '++ OMI-debug: ', debug, 'PDAFomi_init_dim_obs_l_noniso_locweights -- END' - END SUBROUTINE PDAFomi_init_dim_obs_l_noniso_locweights + END SUBROUTINE PDAFomi_init_dim_obs_l_noniso_locweights_old @@ -1158,81 +1158,31 @@ SUBROUTINE PDAFomi_init_obsvar_l(thisobs_l, thisobs, meanvar_l, cnt_obs_l) END SUBROUTINE PDAFomi_init_obsvar_l - - !------------------------------------------------------------------------------- -!> Compute product of inverse of R with some matrix +!> Compute weights for localization !! !! The routine is called during the analysis step -!! on each local analysis domain. It has to -!! compute the product of the inverse of the local -!! observation error covariance matrix with -!! the matrix of locally observed ensemble -!! perturbations. -!! -!! Next to computing the product, a localizing -!! weighting ("observation localization") can be -!! applied to matrix A. +!! on each local analysis domain. !! -!! This implementation assumes a diagonal observation -!! error covariance matrix, and supports varying -!! observation error variances. -!! -!! The routine can be applied with either all observations -!! of different types at once, or separately for each -!! observation type. -!! -!! __Revision history:__ -!! * 2019-06 - Lars Nerger - Initial code from restructuring observation routines -!! * Later revisions - see repository log -!! - SUBROUTINE PDAFomi_prodRinvA_l(thisobs_l, thisobs, nobs_all, ncols, & - A_l, C_l, verbose) + SUBROUTINE PDAFomi_observation_localization_weights(thisobs_l, thisobs, ncols, & + A_l, weight, verbose) - IMPLICIT NONE + IMPLICIT NONE ! *** Arguments *** TYPE(obs_l), INTENT(inout) :: thisobs_l !< Data type with local observation TYPE(obs_f), INTENT(inout) :: thisobs !< Data type with full observation - INTEGER, INTENT(in) :: nobs_all !< Dimension of local obs. vector (all obs. types) INTEGER, INTENT(in) :: ncols !< Rank of initial covariance matrix - REAL, INTENT(inout) :: A_l(:, :) !< Input matrix (thisobs_l%dim_obs_l, ncols) - REAL, INTENT(out) :: C_l(:, :) !< Output matrix (thisobs_l%dim_obs_l, ncols) + REAL, INTENT(in) :: A_l(:, :) !< Input matrix (thisobs_l%dim_obs_l, ncols) INTEGER, INTENT(in) :: verbose !< Verbosity flag + REAL, INTENT(out) :: weight(thisobs_l%dim_obs_l) !> Localization weights ! *** local variables *** - INTEGER :: i, j ! Index of observation component - REAL, ALLOCATABLE :: weight(:) ! Localization weights + INTEGER :: i ! Index of observation component REAL, ALLOCATABLE :: weight_v(:) ! Localization weights for vertical (for locweight_v>0) - INTEGER :: idummy ! Dummy to access nobs_all - INTEGER :: off ! row offset in A_l and C_l - - -! ********************** -! *** INITIALIZATION *** -! ********************** - - doassim: IF (thisobs%doassim == 1) THEN - - ! Initialize dummy to prevent compiler warning - idummy = nobs_all - - ! Initialize offset - off = thisobs_l%off_obs_l ! Screen output - IF (debug>0) THEN - WRITE (*,*) '++ OMI-debug: ', debug, & - 'PDAFomi_prodrinva_l -- START Multiply with inverse R and and apply localization' - WRITE (*,*) '++ OMI-debug prodrinva_l: ', debug, ' thisobs_l%locweight', thisobs_l%locweight - IF (thisobs_l%locweight_v>0) & - WRITE (*,*) '++ OMI-debug prodrinva_l: ', debug, ' thisobs_l%locweight_v', thisobs_l%locweight_v - WRITE (*,*) '++ OMI-debug prodRinvA_l: ', debug, ' thisobs%dim_obs_l', thisobs_l%dim_obs_l - WRITE (*,*) '++ OMI-debug prodRinvA_l: ', debug, ' thisobs%ivar_obs_l', thisobs_l%ivar_obs_l - WRITE (*,*) '++ OMI-debug prodRinvA_l: ', debug, ' Input matrix A_l', A_l - END IF - IF (verbose == 1) THEN WRITE (*, '(a, 5x, a, 1x, i3)') & 'PDAFomi', '--- Domain localization for obs. type ID',thisobs%obsid @@ -1282,8 +1232,6 @@ SUBROUTINE PDAFomi_prodRinvA_l(thisobs_l, thisobs, nobs_all, ncols, & ! *** Initialize weight array - ALLOCATE(weight(thisobs_l%dim_obs_l)) - CALL PDAFomi_weights_l(verbose, thisobs_l%dim_obs_l, ncols, thisobs_l%locweight, & thisobs_l%cradius_l, thisobs_l%sradius_l, & A_l, thisobs_l%ivar_obs_l, thisobs_l%distance_l, weight) @@ -1323,8 +1271,84 @@ SUBROUTINE PDAFomi_prodRinvA_l(thisobs_l, thisobs, nobs_all, ncols, & END IF END DO END IF lw2 + END SUBROUTINE + +!------------------------------------------------------------------------------- +!> Compute product of inverse of R with some matrix +!! +!! The routine is called during the analysis step +!! on each local analysis domain. It has to +!! compute the product of the inverse of the local +!! observation error covariance matrix with +!! the matrix of locally observed ensemble +!! perturbations. +!! +!! Next to computing the product, a localizing +!! weighting ("observation localization") can be +!! applied to matrix A. +!! +!! This implementation assumes a diagonal observation +!! error covariance matrix, and supports varying +!! observation error variances. +!! +!! The routine can be applied with either all observations +!! of different types at once, or separately for each +!! observation type. +!! +!! __Revision history:__ +!! * 2019-06 - Lars Nerger - Initial code from restructuring observation routines +!! * Later revisions - see repository log +!! + SUBROUTINE PDAFomi_prodRinvA_l(thisobs_l, thisobs, nobs_all, ncols, & + A_l, C_l, verbose) + + IMPLICIT NONE + +! *** Arguments *** + TYPE(obs_l), INTENT(inout) :: thisobs_l !< Data type with local observation + TYPE(obs_f), INTENT(inout) :: thisobs !< Data type with full observation + INTEGER, INTENT(in) :: nobs_all !< Dimension of local obs. vector (all obs. types) + INTEGER, INTENT(in) :: ncols !< Rank of initial covariance matrix + REAL, INTENT(inout) :: A_l(:, :) !< Input matrix (thisobs_l%dim_obs_l, ncols) + REAL, INTENT(out) :: C_l(:, :) !< Output matrix (thisobs_l%dim_obs_l, ncols) + INTEGER, INTENT(in) :: verbose !< Verbosity flag + + +! *** local variables *** + INTEGER :: i, j ! Index of observation component + REAL, ALLOCATABLE :: weight(:) ! Localization weights + INTEGER :: idummy ! Dummy to access nobs_all + INTEGER :: off ! row offset in A_l and C_l +! ********************** +! *** INITIALIZATION *** +! ********************** + + doassim: IF (thisobs%doassim == 1) THEN + + ! Initialize dummy to prevent compiler warning + idummy = nobs_all + + ! Initialize offset + off = thisobs_l%off_obs_l + + ! Screen output + IF (debug>0) THEN + WRITE (*,*) '++ OMI-debug: ', debug, & + 'PDAFomi_prodrinva_l -- START Multiply with inverse R and and apply localization' + WRITE (*,*) '++ OMI-debug prodrinva_l: ', debug, ' thisobs_l%locweight', thisobs_l%locweight + IF (thisobs_l%locweight_v>0) & + WRITE (*,*) '++ OMI-debug prodrinva_l: ', debug, ' thisobs_l%locweight_v', thisobs_l%locweight_v + WRITE (*,*) '++ OMI-debug prodRinvA_l: ', debug, ' thisobs%dim_obs_l', thisobs_l%dim_obs_l + WRITE (*,*) '++ OMI-debug prodRinvA_l: ', debug, ' thisobs%ivar_obs_l', thisobs_l%ivar_obs_l + WRITE (*,*) '++ OMI-debug prodRinvA_l: ', debug, ' Input matrix A_l', A_l + END IF + + ALLOCATE(weight(thisobs_l%dim_obs_l)) + call PDAFomi_observation_localization_weights(thisobs_l, thisobs, ncols, A_l, & + weight, verbose) + ! *** Apply weight doweighting: IF (thisobs_l%locweight >= 11) THEN @@ -1337,13 +1361,13 @@ SUBROUTINE PDAFomi_prodRinvA_l(thisobs_l, thisobs, nobs_all, ncols, & END DO ! *** -1 - ! *** C = R A + ! *** C = R A DO j = 1, ncols DO i = 1, thisobs_l%dim_obs_l C_l(i+off, j) = thisobs_l%ivar_obs_l(i) * A_l(i+off, j) END DO END DO - + ELSE doweighting ! *** Apply weight to matrix R only @@ -1352,7 +1376,7 @@ SUBROUTINE PDAFomi_prodRinvA_l(thisobs_l, thisobs, nobs_all, ncols, & C_l(i+off, j) = thisobs_l%ivar_obs_l(i) * weight(i) * A_l(i+off, j) END DO END DO - + END IF doweighting ! *** Clean up *** @@ -3822,7 +3846,11 @@ SUBROUTINE PDAFomi_weights_l(verbose, nobs_l, ncols, locweight, cradius, sradius ! Control verbosity of PDAF_local_weight - IF (verbose==1) verbose_w = 1 + IF (verbose==1) THEN + verbose_w = 1 + ELSE + verbose_w = 0 + END IF IF (locweight /= 4) THEN ! All localizations except regulated weight based on variance at @@ -3977,7 +4005,11 @@ SUBROUTINE PDAFomi_weights_l_sgnl(verbose, nobs_l, ncols, locweight, cradius, sr ! Control verbosity of PDAF_local_weight - IF (verbose==1) verbose_w = 1 + IF (verbose==1) THEN + verbose_w = 1 + ELSE + verbose_w = 0 + END IF IF (locweight /= 4) THEN ! All localizations except regulated weight based on variance at diff --git a/src/PDAFomi_put_state_3dvar.F90 b/src/PDAFomi_put_state_3dvar.F90 index 9c950a23a..70d07a746 100644 --- a/src/PDAFomi_put_state_3dvar.F90 +++ b/src/PDAFomi_put_state_3dvar.F90 @@ -81,6 +81,7 @@ SUBROUTINE PDAFomi_put_state_3dvar(collect_state_pdaf, init_dim_obs_pdaf, obs_op prepoststep_pdaf, outflag) ELSE WRITE (*,*) 'PDAF-ERROR: No valid filter type for PDAFomi_put_state_3dvar' + outflag = 200 END IF diff --git a/src/PDAFomi_put_state_3dvar_nondiagR.F90 b/src/PDAFomi_put_state_3dvar_nondiagR.F90 new file mode 100644 index 000000000..681b3e0f2 --- /dev/null +++ b/src/PDAFomi_put_state_3dvar_nondiagR.F90 @@ -0,0 +1,102 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_put_state_3dvar_nondiagR --- Interface to PDAF for 3D-Var +! +! !INTERFACE: +SUBROUTINE PDAFomi_put_state_3dvar_nondiagR(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prodRinvA_pdafomi, & + cvt_pdaf, cvt_adj_pdaf, obs_op_lin_pdafomi, obs_op_adj_pdafomi, & + prepoststep_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_pdaf ! Apply adjoint control vector transform matrix + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of observation vector + obs_op_pdafomi, & ! Observation operator + obs_op_lin_pdafomi, & ! Linearized observation operator + obs_op_adj_pdafomi, & ! Adjoint observation operator + prodRinvA_pdafomi ! Provide product R^-1 A + EXTERNAL :: PDAFomi_init_obs_f_cb ! Initialize observation vector + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_put_state_3dvar_nondiagR -- START' + + IF (TRIM(filterstr) == '3DVAR') THEN + CALL PDAF_put_state_3dvar(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, prodRinvA_pdafomi, & + cvt_pdaf, cvt_adj_pdaf, obs_op_lin_pdafomi, obs_op_adj_pdafomi, & + prepoststep_pdaf, outflag) + ELSE + WRITE (*,*) 'PDAF-ERROR: No valid filter type for PDAFomi_put_state_3dvar_nondiagR' + outflag = 200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_put_state_3dvar_nondiagR -- END' + +END SUBROUTINE PDAFomi_put_state_3dvar_nondiagR diff --git a/src/PDAFomi_put_state_en3dvar_estkf_nondiagR.F90 b/src/PDAFomi_put_state_en3dvar_estkf_nondiagR.F90 new file mode 100644 index 000000000..a7fd75a8f --- /dev/null +++ b/src/PDAFomi_put_state_en3dvar_estkf_nondiagR.F90 @@ -0,0 +1,103 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_put_state_en3dvar_estkf_nondiagR --- Interface to PDAF for En3D-Var/ESTKF +! +! !INTERFACE: +SUBROUTINE PDAFomi_put_state_en3dvar_estkf_nondiagR(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prodRinvA_pdafomi, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdafomi, obs_op_adj_pdafomi, & + prepoststep_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf ! Apply adjoint control vector transform matrix + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of observation vector + obs_op_pdafomi, & ! Observation operator + obs_op_lin_pdafomi, & ! Linearized observation operator + obs_op_adj_pdafomi, & ! Adjoint observation operator + prodRinvA_pdafomi ! Provide product R^-1 A + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector + PDAFomi_init_obsvar_cb ! Initialize mean observation error variance + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_put_state_en3dvar_estkf_nondiagR -- START' + + IF (TRIM(filterstr) == '3DVAR') THEN + CALL PDAF_put_state_en3dvar_estkf(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, prodRinvA_pdafomi, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdafomi, obs_op_adj_pdafomi, & + PDAFomi_init_obsvar_cb, prepoststep_pdaf, outflag) + ELSE + WRITE (*,*) 'PDAF-ERROR: No valid filter type for PDAFomi_put_state_en3dvar_estkf_nondiagR' + outflag = 200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_put_state_en3dvar_estkf_nondiagR -- END' + +END SUBROUTINE PDAFomi_put_state_en3dvar_estkf_nondiagR diff --git a/src/PDAFomi_put_state_en3dvar_lestkf_nondiagR.F90 b/src/PDAFomi_put_state_en3dvar_lestkf_nondiagR.F90 new file mode 100644 index 000000000..8447c8fdb --- /dev/null +++ b/src/PDAFomi_put_state_en3dvar_lestkf_nondiagR.F90 @@ -0,0 +1,116 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_put_state_en3dvar_lestkf_nondiagR --- Interface to PDAF for En3D-Var/LESTKF +! +! !INTERFACE: +SUBROUTINE PDAFomi_put_state_en3dvar_lestkf_nondiagR(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prodRinvA_pdafomi, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdafomi, obs_op_adj_pdafomi, & + prodRinvA_l_pdafomi, init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdafomi, & + g2l_state_pdaf, l2g_state_pdaf, prepoststep_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf ! Apply adjoint control vector transform matrix + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + g2l_state_pdaf, & ! Get state on local ana. domain from full state + l2g_state_pdaf ! Init full state from local state + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of full observation vector + obs_op_pdafomi, & ! Full observation operator + obs_op_lin_pdafomi, & ! Linearized observation operator + obs_op_adj_pdafomi, & ! Adjoint observation operator + init_dim_obs_l_pdafomi, & ! Initialize local dimimension of obs. vector + prodRinvA_pdafomi, & ! Provide product R^-1 A + prodRinvA_l_pdafomi ! Provide product R^-1 A + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector + PDAFomi_init_obs_l_cb, & ! Initialize local observation vector + PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance + PDAFomi_init_obsvar_l_cb, & ! Initialize local mean observation error variance + PDAFomi_g2l_obs_cb ! Restrict full obs. vector to local analysis domain + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_put_state_en3dvar_lestkf_nondiagR -- START' + + IF (TRIM(filterstr) == '3DVAR') THEN + CALL PDAF_put_state_en3dvar_lestkf(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, prodRinvA_pdafomi, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdafomi, obs_op_adj_pdafomi, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, & + prodRinvA_l_pdafomi, init_n_domains_pdaf, init_dim_l_pdaf, & + init_dim_obs_l_pdafomi, g2l_state_pdaf, l2g_state_pdaf, PDAFomi_g2l_obs_cb, & + PDAFomi_init_obsvar_cb, PDAFomi_init_obsvar_l_cb, prepoststep_pdaf, outflag) + ELSE + WRITE (*,*) 'PDAF-ERROR: No valid filter type for PDAFomi_put_state_en3dvar_lestkf_nondiagR' + outflag = 200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_put_state_en3dvar_lestkf_nondiagR -- END' + +END SUBROUTINE PDAFomi_put_state_en3dvar_lestkf_nondiagR diff --git a/src/PDAFomi_put_state_enkf_nondiagR.F90 b/src/PDAFomi_put_state_enkf_nondiagR.F90 new file mode 100644 index 000000000..3ba6ea62c --- /dev/null +++ b/src/PDAFomi_put_state_enkf_nondiagR.F90 @@ -0,0 +1,99 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_put_state_enkf_nondiagR --- Interface to PDAF for global filters +! +! !INTERFACE: +SUBROUTINE PDAFomi_put_state_enkf_nondiagR(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, add_obs_error_pdafomi, init_obscovar_pdafomi, & + prepoststep_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of observation vector + obs_op_pdafomi, & ! Observation operator + init_obscovar_pdafomi, & ! Initialize mean observation error variance + add_obs_error_pdafomi ! Add observation error covariance matrix + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector + PDAFomi_prodRinvA_cb, & ! Provide product R^-1 A + PDAFomi_likelihood_cb ! Compute likelihood + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_put_state_enkf_nondiagR -- START' + + IF (TRIM(filterstr) == 'ENKF') THEN + CALL PDAF_put_state_enkf(collect_state_pdaf, init_dim_obs_pdafomi, obs_op_pdafomi, & + PDAFomi_init_obs_f_cb, prepoststep_pdaf, add_obs_error_pdafomi, & + init_obscovar_pdafomi, outflag) + ELSE + WRITE (*,*) 'PDAF-ERROR: Invalid filter choice for PDAFomi_put_state_enkf_nondiagR' + outflag=200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_put_state_enkf_nondiagR -- END' + +END SUBROUTINE PDAFomi_put_state_enkf_nondiagR diff --git a/src/PDAFomi_put_state_enkf_nondiagR_si.F90 b/src/PDAFomi_put_state_enkf_nondiagR_si.F90 new file mode 100644 index 000000000..5967f6788 --- /dev/null +++ b/src/PDAFomi_put_state_enkf_nondiagR_si.F90 @@ -0,0 +1,75 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_put_state_enkf_nondiagR_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFomi_put_state_enkf_nondiagR_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + ! Interface to PDAF-OMI for local and global filters + EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain + obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain + init_obscovar_pdafomi, & ! Initialize mean observation error variance + add_obs_error_pdafomi ! Add observation error covariance matrix + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFomi_put_state_enkf_nondiagR +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFomi_put_state_enkf_nondiagR(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, add_obs_error_pdafomi, init_obscovar_pdafomi, & + prepoststep_pdaf, outflag) + +END SUBROUTINE PDAFomi_put_state_enkf_nondiagR_si diff --git a/src/PDAFomi_put_state_global_nondiagR.F90 b/src/PDAFomi_put_state_global_nondiagR.F90 new file mode 100644 index 000000000..e57d9f009 --- /dev/null +++ b/src/PDAFomi_put_state_global_nondiagR.F90 @@ -0,0 +1,116 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_put_state_global_nondiagR --- Interface to PDAF for global filters +! +! !INTERFACE: +SUBROUTINE PDAFomi_put_state_global_nondiagR(collect_state_pdaf, & + init_dim_obs_pdaf, obs_op_pdaf, prodRinvA_pdaf, prepoststep_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_dim_obs_pdaf, & ! Initialize dimension of observation vector + obs_op_pdaf ! Observation operator + EXTERNAL :: prodRinvA_pdaf ! Provide product R^-1 A + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector + PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance + PDAFomi_init_obscovar_cb, & ! Initialize mean observation error variance + PDAFomi_add_obs_error_cb ! Add observation error covariance matrix + + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_put_state_global_nondiagR -- START' + + IF (TRIM(filterstr) == 'SEIK') THEN + CALL PDAF_put_state_seik(collect_state_pdaf, init_dim_obs_pdaf, obs_op_pdaf, & + PDAFomi_init_obs_f_cb, prepoststep_pdaf, & + prodRinvA_pdaf, PDAFomi_init_obsvar_cb, outflag) + ELSEIF (TRIM(filterstr) == 'ENKF') THEN + WRITE (*,*) 'PDAF-ERROR: Use PDAFomi_put_state_enkf_nondiagR for EnKF' + outflag=200 + ELSEIF (TRIM(filterstr) == 'ETKF') THEN + CALL PDAF_put_state_etkf(collect_state_pdaf, init_dim_obs_pdaf, obs_op_pdaf, & + PDAFomi_init_obs_f_cb, prepoststep_pdaf, & + prodRinvA_pdaf, PDAFomi_init_obsvar_cb, outflag) + ELSEIF (TRIM(filterstr) == 'ESTKF') THEN + CALL PDAF_put_state_estkf(collect_state_pdaf, init_dim_obs_pdaf, obs_op_pdaf, & + PDAFomi_init_obs_f_cb, prepoststep_pdaf, & + prodRinvA_pdaf, PDAFomi_init_obsvar_cb, outflag) + ELSEIF (TRIM(filterstr) == 'NETF') THEN + WRITE (*,*) 'PDAF-ERROR: Use PDAFomi_put_state_nonlin_nondiagR for NETF and PF' + outflag=200 + ELSEIF (TRIM(filterstr) == 'PF') THEN + WRITE (*,*) 'PDAF-ERROR: Use PDAFomi_put_state_nonlin_nondiagR for NETF and PF' + outflag=200 + ELSE + WRITE (*,*) 'PDAF-ERROR: Invalid filter choice for PDAFomi_put_state_global_nondiagR' + outflag=200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_put_state_global_nondiagR -- END' + +END SUBROUTINE PDAFomi_put_state_global_nondiagR diff --git a/src/PDAFomi_put_state_global_nondiagR_si.F90 b/src/PDAFomi_put_state_global_nondiagR_si.F90 new file mode 100644 index 000000000..de10367e6 --- /dev/null +++ b/src/PDAFomi_put_state_global_nondiagR_si.F90 @@ -0,0 +1,74 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_put_state_global_nondiagR_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFomi_put_state_global_nondiagR_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + ! Interface to PDAF-OMI for local and global filters + EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain + obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain + prodRinvA_pdafomi ! Provide product R^-1 A + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFomi_put_state_global_nondiagR +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFomi_put_state_global_nondiagR(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prodRinvA_pdafomi, prepoststep_pdaf, & + outflag) + +END SUBROUTINE PDAFomi_put_state_global_nondiagR_si diff --git a/src/PDAFomi_put_state_hyb3dvar_estkf_nondiagR.F90 b/src/PDAFomi_put_state_hyb3dvar_estkf_nondiagR.F90 new file mode 100644 index 000000000..8cf10eb43 --- /dev/null +++ b/src/PDAFomi_put_state_hyb3dvar_estkf_nondiagR.F90 @@ -0,0 +1,107 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_put_state_hyb3dvar_estkf_nondiagR --- Interface to PDAF for Hyb3D-Var/ESTKF +! +! !INTERFACE: +SUBROUTINE PDAFomi_put_state_hyb3dvar_estkf_nondiagR(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prodRinvA_pdafomi, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, cvt_pdaf, cvt_adj_pdaf, & + obs_op_lin_pdafomi, obs_op_adj_pdafomi, & + prepoststep_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_pdaf, & ! Apply adjoint control vector transform matrix + cvt_ens_pdaf, & ! Apply ensemble control vector transform matrix to control vector + cvt_adj_ens_pdaf ! Apply adjoint ensemble control vector transform matrix + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of observation vector + obs_op_pdafomi, & ! Observation operator + obs_op_lin_pdafomi, & ! Linearized observation operator + obs_op_adj_pdafomi, & ! Adjoint observation operator + prodRinvA_pdafomi ! Provide product R^-1 A + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector + PDAFomi_init_obsvar_cb ! Initialize mean observation error variance + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_put_state_hyb3dvar_estkf_nondiagR -- START' + + IF (TRIM(filterstr) == '3DVAR') THEN + CALL PDAF_put_state_hyb3dvar_estkf(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, prodRinvA_pdafomi, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, cvt_pdaf, cvt_adj_pdaf, & + obs_op_lin_pdafomi, obs_op_adj_pdafomi, PDAFomi_init_obsvar_cb, & + prepoststep_pdaf, outflag) + ELSE + WRITE (*,*) 'PDAF-ERROR: No valid filter type for PDAFomi_put_state_hyb3dvar_estkf_nondiagR' + outflag = 200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_put_state_hyb3dvar_estkf_nondiagR -- END' + +END SUBROUTINE PDAFomi_put_state_hyb3dvar_estkf_nondiagR diff --git a/src/PDAFomi_put_state_hyb3dvar_lestkf_nondiagR.F90 b/src/PDAFomi_put_state_hyb3dvar_lestkf_nondiagR.F90 new file mode 100644 index 000000000..504a93303 --- /dev/null +++ b/src/PDAFomi_put_state_hyb3dvar_lestkf_nondiagR.F90 @@ -0,0 +1,120 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_put_state_hyb3dvar_lestkf_nondiagR --- Interface to PDAF for Hyb3D-Var/LESTKF +! +! !INTERFACE: +SUBROUTINE PDAFomi_put_state_hyb3dvar_lestkf_nondiagR(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prodRinvA_pdafomi, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, cvt_pdaf, cvt_adj_pdaf, & + obs_op_lin_pdafomi, obs_op_adj_pdafomi, & + prodRinvA_l_pdafomi, init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdafomi, & + g2l_state_pdaf, l2g_state_pdaf, prepoststep_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: cvt_ens_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_ens_pdaf, & ! Apply adjoint control vector transform matrix + cvt_pdaf, & ! Apply control vector transform matrix to control vector + cvt_adj_pdaf ! Apply adjoint control vector transform matrix + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + g2l_state_pdaf, & ! Get state on local ana. domain from full state + l2g_state_pdaf ! Init full state from local state + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of full observation vector + obs_op_pdafomi, & ! Full observation operator + obs_op_lin_pdafomi, & ! Linearized observation operator + obs_op_adj_pdafomi, & ! Adjoint observation operator + init_dim_obs_l_pdafomi, & ! Initialize local dimimension of obs. vector + prodRinvA_pdafomi, & ! Provide product R^-1 A + prodRinvA_l_pdafomi ! Provide product R^-1 A + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector + PDAFomi_init_obs_l_cb, & ! Initialize local observation vector + PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance + PDAFomi_init_obsvar_l_cb, & ! Initialize local mean observation error variance + PDAFomi_prodRinvA_cb, & ! Provide product R^-1 A + PDAFomi_g2l_obs_cb ! Restrict full obs. vector to local analysis domain + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_put_state_hyb3dvar_lestkf_nondiagR -- START' + + IF (TRIM(filterstr) == '3DVAR') THEN + CALL PDAF_put_state_hyb3dvar_lestkf(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, prodRinvA_pdafomi, & + cvt_ens_pdaf, cvt_adj_ens_pdaf, cvt_pdaf, cvt_adj_pdaf, obs_op_lin_pdafomi, obs_op_adj_pdafomi, & + init_dim_obs_pdafomi, obs_op_pdafomi, PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, & + prodRinvA_l_pdafomi, init_n_domains_pdaf, init_dim_l_pdaf, & + init_dim_obs_l_pdafomi, g2l_state_pdaf, l2g_state_pdaf, PDAFomi_g2l_obs_cb, & + PDAFomi_init_obsvar_cb, PDAFomi_init_obsvar_l_cb, prepoststep_pdaf, outflag) + ELSE + WRITE (*,*) 'PDAF-ERROR: No valid filter type for PDAFomi_put_state_hyb3dvar_lestkf_nondiagR' + outflag = 200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_put_state_hyb3dvar_lestkf_nondiagR -- END' + +END SUBROUTINE PDAFomi_put_state_hyb3dvar_lestkf_nondiagR diff --git a/src/PDAFomi_put_state_lenkf_nondiagR.F90 b/src/PDAFomi_put_state_lenkf_nondiagR.F90 new file mode 100644 index 000000000..d19a51c1a --- /dev/null +++ b/src/PDAFomi_put_state_lenkf_nondiagR.F90 @@ -0,0 +1,94 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_put_state_lenkf_nondiagR --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFomi_put_state_lenkf_nondiagR(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, localize_covar_pdafomi, & + add_obs_error_pdafomi, init_obscovar_pdafomi, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! Variant for LENKF with domain decomposition. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of observation vector + obs_op_pdafomi, & ! Observation operator + localize_covar_pdafomi, & ! Apply localization to HP and HPH^T + init_obscovar_pdafomi, & ! Initialize mean observation error variance + add_obs_error_pdafomi ! Provide product R^-1 A + EXTERNAL :: PDAFomi_init_obs_f_cb ! Initialize observation vector + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAF_put_state_lenkf +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_put_state_lenkf_nondiagR -- START' + + CALL PDAF_put_state_lenkf(collect_state_pdaf, init_dim_obs_pdafomi, obs_op_pdafomi, & + PDAFomi_init_obs_f_cb, prepoststep_pdaf, localize_covar_pdafomi, & + add_obs_error_pdafomi, init_obscovar_pdafomi, outflag) + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_put_state_lenkf_nondiagR -- END' + +END SUBROUTINE PDAFomi_put_state_lenkf_nondiagR diff --git a/src/PDAFomi_put_state_lenkf_nondiagR_si.F90 b/src/PDAFomi_put_state_lenkf_nondiagR_si.F90 new file mode 100644 index 000000000..ede97b240 --- /dev/null +++ b/src/PDAFomi_put_state_lenkf_nondiagR_si.F90 @@ -0,0 +1,76 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_put_state_lenkf_nondiagR_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFomi_put_state_lenkf_nondiagR_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + ! Interface to PDAF-OMI for local and global filters + EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain + obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain + localize_covar_pdafomi, & ! Apply localization to HP and HPH^T + init_obscovar_pdafomi, & ! Initialize mean observation error variance + add_obs_error_pdafomi ! Provide product R^-1 A + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFomi_put_state_lenkf_nondiagR +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFomi_put_state_lenkf_nondiagR(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, localize_covar_pdafomi, & + add_obs_error_pdafomi, init_obscovar_pdafomi, outflag) + +END SUBROUTINE PDAFomi_put_state_lenkf_nondiagR_si diff --git a/src/PDAFomi_put_state_lknetf_nondiagR.F90 b/src/PDAFomi_put_state_lknetf_nondiagR.F90 new file mode 100644 index 000000000..b3e470db6 --- /dev/null +++ b/src/PDAFomi_put_state_lknetf_nondiagR.F90 @@ -0,0 +1,114 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_put_state_lknetf_nondiagR --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFomi_put_state_lknetf_nondiagR(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, prodRinvA_l_pdafomi, prodRinvA_hyb_l_pdafomi, & + likelihood_l_pdafomi, likelihood_hyb_l_pdafomi, g2l_state_pdaf, l2g_state_pdaf, & + outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all domain-localized filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + g2l_state_pdaf, & ! Get state on local ana. domain from full state + l2g_state_pdaf ! Init full state from local state + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of full observation vector + obs_op_pdafomi, & ! Full observation operator + init_dim_obs_l_pdafomi, & ! Initialize local dimimension of obs. vector + prodRinvA_l_pdafomi, & ! Provide product R^-1 A on local analysis domain + likelihood_l_pdafomi, & ! Compute likelihood and apply localization + prodRinvA_hyb_l_pdafomi, & ! Product R^-1 A on local analysis domain with hybrid weight + likelihood_hyb_l_pdafomi ! Compute likelihood and apply localization with tempering + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize full observation vector + PDAFomi_init_obs_l_cb, & ! Initialize local observation vector + PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance + PDAFomi_init_obsvar_l_cb, & ! Initialize local mean observation error variance + PDAFomi_g2l_obs_cb ! Restrict full obs. vector to local analysis domain + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_put_state_lknetf_nondiagR -- START' + + IF (TRIM(filterstr) == 'LKNETF') THEN + CALL PDAF_put_state_lknetf(collect_state_pdaf, init_dim_obs_pdafomi, obs_op_pdafomi, & + PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, prepoststep_pdaf, & + prodRinvA_l_pdafomi, prodRinvA_hyb_l_pdafomi, & + init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdafomi, & + g2l_state_pdaf, l2g_state_pdaf, PDAFomi_g2l_obs_cb, PDAFomi_init_obsvar_cb, & + PDAFomi_init_obsvar_l_cb, likelihood_l_pdafomi, likelihood_hyb_l_pdafomi, & + outflag) + ELSE + WRITE (*,*) 'PDAF-ERROR: Invalid filter choice for PDAFomi_put_state_lknetf_nondiagR' + outflag=200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_put_state_lknetf_nondiagR -- END' + +END SUBROUTINE PDAFomi_put_state_lknetf_nondiagR diff --git a/src/PDAFomi_put_state_lknetf_nondiagR_si.F90 b/src/PDAFomi_put_state_lknetf_nondiagR_si.F90 new file mode 100644 index 000000000..153a5476f --- /dev/null +++ b/src/PDAFomi_put_state_lknetf_nondiagR_si.F90 @@ -0,0 +1,84 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_put_state_lknetf_nondiagR_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFomi_put_state_lknetf_nondiagR_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all domain-localized filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + g2l_state_pdaf, & ! Get state on local ana. domain from full state + l2g_state_pdaf ! Init full state from local state + EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain + obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain + init_dim_obs_l_pdafomi, & ! Get dimension of obs. vector for local analysis domain + prodRinvA_l_pdafomi, & ! Provide product R^-1 A on local analysis domain + prodRinvA_hyb_l_pdafomi, & ! Provide product R^-1 A on local analysis domain with hybrid weight + likelihood_l_pdafomi, & ! Compute observation likelihood for an ensemble member + likelihood_hyb_l_pdafomi ! Compute observation likelihood for an ensemble member with hybrid weight + + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFomi_put_state_lknetf_nondiagR +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFomi_put_state_lknetf_nondiagR(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, prodRinvA_l_pdafomi, prodRinvA_hyb_l_pdafomi, & + likelihood_l_pdafomi, likelihood_hyb_l_pdafomi, g2l_state_pdaf, l2g_state_pdaf, & + outflag) + +END SUBROUTINE PDAFomi_put_state_lknetf_nondiagR_si diff --git a/src/PDAFomi_put_state_lnetf_nondiagR.F90 b/src/PDAFomi_put_state_lnetf_nondiagR.F90 new file mode 100644 index 000000000..5817b2bf7 --- /dev/null +++ b/src/PDAFomi_put_state_lnetf_nondiagR.F90 @@ -0,0 +1,107 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_put_state_lnetf_nondiagR --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFomi_put_state_lnetf_nondiagR(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, likelihood_l_pdafomi, g2l_state_pdaf, l2g_state_pdaf, & + outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all domain-localized filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + g2l_state_pdaf, & ! Get state on local ana. domain from full state + l2g_state_pdaf ! Init full state from local state + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of full observation vector + obs_op_pdafomi, & ! Full observation operator + init_dim_obs_l_pdafomi, & ! Initialize local dimimension of obs. vector + likelihood_l_pdafomi ! Compute likelihood and apply localization + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize full observation vector + PDAFomi_init_obs_l_cb, & ! Initialize local observation vector + PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance + PDAFomi_init_obsvar_l_cb, & ! Initialize local mean observation error variance + PDAFomi_g2l_obs_cb ! Restrict full obs. vector to local analysis domain + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_put_state_lnetf_nondiagR -- START' + + IF (TRIM(filterstr) == 'LNETF') THEN + CALL PDAF_put_state_lnetf(collect_state_pdaf, init_dim_obs_pdafomi, obs_op_pdafomi, & + PDAFomi_init_obs_l_cb, prepoststep_pdaf, likelihood_l_pdafomi, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, g2l_state_pdaf, l2g_state_pdaf, & + PDAFomi_g2l_obs_cb, outflag) + ELSE + WRITE (*,*) 'PDAF-ERROR: Invalid filter choice for PDAFomi_put_state_lnetf_nondiagR' + outflag=200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_put_state_lnetf_nondiagR -- END' + +END SUBROUTINE PDAFomi_put_state_lnetf_nondiagR diff --git a/src/PDAFomi_put_state_lnetf_nondiagR_si.F90 b/src/PDAFomi_put_state_lnetf_nondiagR_si.F90 new file mode 100644 index 000000000..f40da3d9b --- /dev/null +++ b/src/PDAFomi_put_state_lnetf_nondiagR_si.F90 @@ -0,0 +1,81 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_put_state_lnetf_nondiagR_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFomi_put_state_lnetf_nondiagR_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all domain-localized filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + g2l_state_pdaf, & ! Get state on local ana. domain from full state + l2g_state_pdaf ! Init full state from local state + EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain + obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain + init_dim_obs_l_pdafomi, & ! Get dimension of obs. vector for local analysis domain + likelihood_l_pdafomi ! Compute likelihood and apply localization + + + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFomi_put_state_lnetf_nondiagR +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFomi_put_state_lnetf_nondiagR(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, likelihood_l_pdafomi, g2l_state_pdaf, l2g_state_pdaf, & + outflag) + +END SUBROUTINE PDAFomi_put_state_lnetf_nondiagR_si diff --git a/src/PDAFomi_put_state_local_nondiagR.F90 b/src/PDAFomi_put_state_local_nondiagR.F90 new file mode 100644 index 000000000..6258663a3 --- /dev/null +++ b/src/PDAFomi_put_state_local_nondiagR.F90 @@ -0,0 +1,126 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_put_state_local_nondiagR --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFomi_put_state_local_nondiagR(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, prodRinvA_l_pdafomi, & + g2l_state_pdaf, l2g_state_pdaf, outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all domain-localized filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-07 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + g2l_state_pdaf, & ! Get state on local ana. domain from full state + l2g_state_pdaf ! Init full state from local state + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of full observation vector + obs_op_pdafomi, & ! Full observation operator + init_dim_obs_l_pdafomi, & ! Initialize local dimimension of obs. vector + prodRinvA_l_pdafomi ! Provide product of inverse of R with matrix A + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize full observation vector + PDAFomi_init_obs_l_cb, & ! Initialize local observation vector + PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance + PDAFomi_init_obsvar_l_cb, & ! Initialize local mean observation error variance + PDAFomi_g2l_obs_cb ! Restrict full obs. vector to local analysis domain + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_put_state_local_nondiagR -- START' + + IF (TRIM(filterstr) == 'LSEIK') THEN + CALL PDAF_put_state_lseik(collect_state_pdaf, init_dim_obs_pdafomi, obs_op_pdafomi, & + PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, prepoststep_pdaf, & + prodRinvA_l_pdafomi, init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdafomi, & + g2l_state_pdaf, l2g_state_pdaf, PDAFomi_g2l_obs_cb, PDAFomi_init_obsvar_cb, & + PDAFomi_init_obsvar_l_cb, outflag) + ELSE IF (TRIM(filterstr) == 'LETKF') THEN + CALL PDAF_put_state_letkf(collect_state_pdaf, init_dim_obs_pdafomi, obs_op_pdafomi, & + PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, prepoststep_pdaf, & + prodRinvA_l_pdafomi, init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdafomi, & + g2l_state_pdaf, l2g_state_pdaf, PDAFomi_g2l_obs_cb, PDAFomi_init_obsvar_cb, & + PDAFomi_init_obsvar_l_cb, outflag) + ELSE IF (TRIM(filterstr) == 'LESTKF') THEN + CALL PDAF_put_state_lestkf(collect_state_pdaf, init_dim_obs_pdafomi, obs_op_pdafomi, & + PDAFomi_init_obs_f_cb, PDAFomi_init_obs_l_cb, prepoststep_pdaf, & + prodRinvA_l_pdafomi, init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdafomi, & + g2l_state_pdaf, l2g_state_pdaf, PDAFomi_g2l_obs_cb, PDAFomi_init_obsvar_cb, & + PDAFomi_init_obsvar_l_cb, outflag) + ELSE IF (TRIM(filterstr) == 'LNETF') THEN + WRITE (*,*) 'PDAF-ERROR: Use PDAFomi_put_state_lnetf_nondiagR for LNETF' + outflag=200 + ELSE IF (TRIM(filterstr) == 'LKNETF') THEN + WRITE (*,*) 'PDAF-ERROR: Use PDAFomi_put_state_lknetf_nondiagR for LKNETF' + outflag=200 + ELSE + WRITE (*,*) 'PDAF-ERROR: Invalid filter choice for PDAFomi_put_state_local_nondiagR' + outflag=200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_put_state_local_nondiagR -- END' + +END SUBROUTINE PDAFomi_put_state_local_nondiagR diff --git a/src/PDAFomi_put_state_local_nondiagR_si.F90 b/src/PDAFomi_put_state_local_nondiagR_si.F90 new file mode 100644 index 000000000..4e566efe8 --- /dev/null +++ b/src/PDAFomi_put_state_local_nondiagR_si.F90 @@ -0,0 +1,80 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_put_state_local_nondiagR_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFomi_put_state_local_nondiagR_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all domain-localized filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-07 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains + init_dim_l_pdaf, & ! Init state dimension for local ana. domain + g2l_state_pdaf, & ! Get state on local ana. domain from full state + l2g_state_pdaf ! Init full state from local state + EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain + obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain + init_dim_obs_l_pdafomi, & ! Get dimension of obs. vector for local analysis domain + prodRinvA_l_pdafomi ! Provide product of inverse of R with matrix A + + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFomi_put_state_local_nondiagR +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFomi_put_state_local_nondiagR(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & + init_dim_l_pdaf, init_dim_obs_l_pdafomi, prodRinvA_l_pdafomi, & + g2l_state_pdaf, l2g_state_pdaf, outflag) + +END SUBROUTINE PDAFomi_put_state_local_nondiagR_si diff --git a/src/PDAFomi_put_state_nonlin_nondiagR.F90 b/src/PDAFomi_put_state_nonlin_nondiagR.F90 new file mode 100644 index 000000000..5870feda1 --- /dev/null +++ b/src/PDAFomi_put_state_nonlin_nondiagR.F90 @@ -0,0 +1,101 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_put_state_nonlin_nondiagR --- Interface to PDAF for global filters +! +! !INTERFACE: +SUBROUTINE PDAFomi_put_state_nonlin_nondiagR(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, likelihood_pdafomi, prepoststep_pdaf, & + outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + USE PDAF_mod_filter, ONLY: filterstr, debug + USE PDAFomi, ONLY: PDAFomi_dealloc + + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + EXTERNAL :: init_dim_obs_pdafomi, & ! Initialize dimension of observation vector + obs_op_pdafomi, & ! Observation operator + likelihood_pdafomi ! Compute likelihood + EXTERNAL :: PDAFomi_init_obs_f_cb, & ! Initialize observation vector + PDAFomi_init_obsvar_cb, & ! Initialize mean observation error variance + PDAFomi_init_obscovar_cb, & ! Initialize mean observation error variance + PDAFomi_add_obs_error_cb ! Add observation error covariance matrix + +! !CALLING SEQUENCE: +! Called by: model code +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_put_state_nonlin_nondiagR -- START' + + IF (TRIM(filterstr) == 'NETF') THEN + CALL PDAF_put_state_netf(collect_state_pdaf, init_dim_obs_pdafomi, obs_op_pdafomi, & + PDAFomi_init_obs_f_cb, prepoststep_pdaf, likelihood_pdafomi, outflag) + ELSEIF (TRIM(filterstr) == 'PF') THEN + CALL PDAF_put_state_pf(collect_state_pdaf, init_dim_obs_pdafomi, obs_op_pdafomi, & + PDAFomi_init_obs_f_cb, prepoststep_pdaf, likelihood_pdafomi, outflag) + ELSE + WRITE (*,*) 'PDAF-ERROR: Invalid filter choice for PDAFomi_put_state_nonlin_nondiagR' + outflag=200 + END IF + + +! ******************************************* +! *** Deallocate and re-init observations *** +! ******************************************* + + CALL PDAFomi_dealloc() + + IF (debug>0) & + WRITE (*,*) '++ PDAFomi-debug: ', debug, 'PDAFomi_put_state_nonlin_nondiagR -- END' + +END SUBROUTINE PDAFomi_put_state_nonlin_nondiagR diff --git a/src/PDAFomi_put_state_nonlin_nondiagR_si.F90 b/src/PDAFomi_put_state_nonlin_nondiagR_si.F90 new file mode 100644 index 000000000..d48711311 --- /dev/null +++ b/src/PDAFomi_put_state_nonlin_nondiagR_si.F90 @@ -0,0 +1,74 @@ +! Copyright (c) 2004-2024 Lars Nerger +! +! This file is part of PDAF. +! +! PDAF is free software: you can redistribute it and/or modify +! it under the terms of the GNU Lesser General Public License +! as published by the Free Software Foundation, either version +! 3 of the License, or (at your option) any later version. +! +! PDAF is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public +! License along with PDAF. If not, see . +! +!$Id$ +!BOP +! +! !ROUTINE: PDAFomi_put_state_nonlin_nondiagR_si --- Interface to transfer state to PDAF +! +! !INTERFACE: +SUBROUTINE PDAFomi_put_state_nonlin_nondiagR_si(outflag) + +! !DESCRIPTION: +! Interface routine called from the model during the +! forecast of each ensemble state to transfer data +! from the model to PDAF and to perform the analysis +! step. +! +! This routine provides the simplified interface +! where names of user-provided subroutines are +! fixed. It simply calls the routine with the +! full interface using pre-defined routine names. +! +! The routine supports all global filters. +! +! ! This is a core routine of PDAF and +! should not be changed by the user ! +! +! !REVISION HISTORY: +! 2024-08 - Lars Nerger - Initial code +! Later revisions - see svn log +! +! !USES: + IMPLICIT NONE + +! !ARGUMENTS: + INTEGER, INTENT(inout) :: outflag ! Status flag + +! ! Names of external subroutines + EXTERNAL :: collect_state_pdaf, & ! Routine to collect a state vector + prepoststep_pdaf ! User supplied pre/poststep routine + ! Interface to PDAF-OMI for local and global filters + EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain + obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain + likelihood_pdafomi ! Compute likelihood + +! !CALLING SEQUENCE: +! Called by: model code +! Calls: PDAFomi_put_state_nonlin_nondiagR +!EOP + + +! ************************************************** +! *** Call the full put_state interface routine *** +! ************************************************** + + CALL PDAFomi_put_state_nonlin_nondiagR(collect_state_pdaf, & + init_dim_obs_pdafomi, obs_op_pdafomi, likelihood_pdafomi, prepoststep_pdaf, & + outflag) + +END SUBROUTINE PDAFomi_put_state_nonlin_nondiagR_si diff --git a/templates/classical/offline/Makefile b/templates/classical/offline/Makefile index 94c662a93..6e52683fe 100644 --- a/templates/classical/offline/Makefile +++ b/templates/classical/offline/Makefile @@ -114,7 +114,7 @@ $(EXE) : libpdaf-d.a \ libpdaf-d.a: @echo "++++++ Generate Filter library ++++++" - @cd $(BASEDIR)/src; make; + @cd $(BASEDIR); make; ###################################################### @@ -135,4 +135,4 @@ clean : cleanpdaf: @echo "+++ Clean up PDAF directory" - cd $(BASEDIR)/src; make clean + cd $(BASEDIR); make clean diff --git a/templates/classical/offline/dummympi/mpif.h b/templates/classical/offline/dummympi/mpif.h deleted file mode 100644 index 0c74a3d1e..000000000 --- a/templates/classical/offline/dummympi/mpif.h +++ /dev/null @@ -1,20 +0,0 @@ -! This is a strongly reduced header file for those -! MPI variables used in PDAF MPI calls. This is only -! intended for compilation without a real MPI library. - - INTEGER MPI_STATUS_SIZE - PARAMETER (MPI_STATUS_SIZE=4) - - INTEGER MPI_INTEGER, MPI_REAL, MPI_DOUBLE_PRECISION, MPI_REAL8 - PARAMETER (MPI_REAL=26,MPI_DOUBLE_PRECISION=27,MPI_INTEGER=28,MPI_REAL8=27) - - INTEGER MPI_LOGICAL, MPI_UNDEFINED - PARAMETER (MPI_LOGICAL=29,MPI_UNDEFINED=30) - - INTEGER MPI_COMM_WORLD - PARAMETER (MPI_COMM_WORLD=91) - - INTEGER MPI_COMM_NULL - PARAMETER (MPI_COMM_NULL=92) - - INTEGER MPI_SUM, MPI_MAX diff --git a/templates/classical/offline/init_pdaf_parse.F90 b/templates/classical/offline/init_pdaf_parse.F90 index 4be0eae19..07718f727 100644 --- a/templates/classical/offline/init_pdaf_parse.F90 +++ b/templates/classical/offline/init_pdaf_parse.F90 @@ -25,8 +25,8 @@ SUBROUTINE init_pdaf_parse() USE mod_assimilation, & ! Variables for assimilation ONLY: screen, filtertype, subtype, dim_ens, delt_obs, & rms_obs, model_error, model_err_amp, incremental, type_forget, & - forget, epsilon, rank_ana_enkf, locweight, cradius, & - sradius, int_rediag, filename, type_trans, dim_obs, & + forget, rank_ana_enkf, locweight, cradius, & + sradius, filename, type_trans, dim_obs, & type_sqrt IMPLICIT NONE @@ -73,10 +73,6 @@ SUBROUTINE init_pdaf_parse() ! Filter-specific settings handle = 'type_trans' ! Type of ensemble transformation in SEIK/ETKF/LSEIK/LETKF CALL parse(handle, type_trans) - handle = 'epsilon' ! Set EPSILON for SEEK - CALL parse(handle, epsilon) - handle = 'int_rediag' ! Time step interval for rediagonalization in SEEK - CALL parse(handle, int_rediag) handle = 'rank_ana_enkf' ! Set rank for pseudo inverse in EnKF CALL parse(handle, rank_ana_enkf) handle = 'type_forget' ! Set type of forgetting factor diff --git a/templates/classical/offline/parser_mpi.F90 b/templates/classical/offline/parser_mpi.F90 index 709c0e5c8..603ab46c0 100644 --- a/templates/classical/offline/parser_mpi.F90 +++ b/templates/classical/offline/parser_mpi.F90 @@ -1,62 +1,60 @@ -!$Id$ -!BOP -! -! !MODULE: +!> Command line parser +!! +!! This module provides routine to parse command line +!! arguments of different types. This version is for +!! use with MPI parallelization. +!! +!! By default, this routine uses the intrinsics +!! 'get_command_count' and 'get_command_argument' +!! that are defined by the Fortran 2003 standard. +!! If a compiler does not support these functions, you +!! can use '-DF77' as a definition for the preprocessor. +!! In this case the Fortran77 standard 'iargc()' and +!! 'getarg()' are used. +!! +!! The module provides a generic subroutine to parse +!! variables of type INTEGER, REAL, or CHARACTER +!! (with length up to 100) from the command line. +!! +!! Usage: +!! SUBROUTINE PARSE(char(len=32) handle, variable) +!! The string 'handle' determines the name of +!! the parsed variable. +!! Example: handle='iters' parses a variable +!! specified on the command line by +!! '-iters value' +!! +!! Usage: +!! CALL PARSE(handle, int_variable) +!! Parses a variable of type integer +!! whose name is given by the string +!! handle. +!! +!! CALL PARSE(handle, real_variable) +!! Parses a variable of type real +!! whose name is given by the string +!! handle. +!! +!! CALL PARSE(handle, character_variable) +!! Parses a string variable of maxmimal +!! length of 100 characters whose name is +!! given by the string handle. +!! +!! CALL PARSE(handle, logical_variable) +!! Parses a variable of type logical +!! whose name is given by the string +!! handle. In the command line it has +!! to be specified as 'T' or 'F'. +!! +!! __Revision history:__ +!! * 2003-02 - Stephan Frickenhaus, Lars Nerger - Initial code +!! * Later revisions - see repository log +!! MODULE parser -! !DESCRIPTION: -! This module provides routine to parse command line -! arguments of different types. This version is for -! use with MPI parallelization. -! By default, this routine uses the intrinsics -! 'get\_command\_count' and 'get\_command\_argument' -! that are define by the Fortran 2003 standard. -! If a compiler does not support these functions, you -! can use '-DF77' as a definition for the preprocessor. -! In this case the Fortran77 standard 'iargc()' and -! 'getarg()' are used. -! -! The module provides a generic subroutine to parse -! variables of type INTEGER, REAL, or CHARACTER -! (with length up to 100) from the command line. -! -! Usage: \begin{verbatim} -! SUBROUTINE PARSE(char(len=32) handle, variable) -! The string 'handle' determines the name of -! the parsed variable. -! Example: handle='iters' parses a variable -! specified on the command line by -! '-iters value' -! -! Usage: -! CALL PARSE(handle, int_variable) -! Parses a variable of type integer -! whose name is given by the string -! handle. -! -! CALL PARSE(handle, real_variable) -! Parses a variable of type real -! whose name is given by the string -! handle. -! -! CALL PARSE(handle, character_variable) -! Parses a string variable of maxmimal -! length of 100 characters whose name is -! given by the string handle. -! -! CALL PARSE(handle, logical_variable) -! Parses a variable of type logical -! whose name is given by the string -! handle. In the command line it has -! to be specified as 'T' or 'F'. -! \end{verbatim} -! -! !REVISION HISTORY: -! 2003-02 - Stephan Frickenhaus, Lars Nerger - Initial code -! Later revisions - see svn log -! -! !USES: - USE mpi + use mpi + USE mod_parallel, & + ONLY: abort_parallel IMPLICIT NONE SAVE @@ -191,6 +189,8 @@ SUBROUTINE parse_string(handle, charvalue) ! *** local variables *** CHARACTER(len=100) :: string CHARACTER(len=100) :: parsed_string + CHARACTER(len=110) :: str1_check + CHARACTER(len=110) :: str2_check LOGICAL :: modified ! *** Initialize *** @@ -210,9 +210,27 @@ SUBROUTINE parse_string(handle, charvalue) DO i = 1, command_argument_count() - 1 CALL get_command_argument(i, str1) CALL get_command_argument(i+1, str2) + + ! Add check for inadmissible strings longer than 100 + ! characters + CALL get_command_argument(i, str1_check) + CALL get_command_argument(i+1, str2_check) + IF (mype == 0) THEN + IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN + WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long." + WRITE (*,'(2x, a, 1x, a)') "called handle=", TRIM(string) + WRITE (*,'(2x, a, 1x, a)') "parsed handle=", TRIM(str1) + WRITE (*,'(2x, a, 1x, a)') "parsed input(cut)=", TRIM(str2) + call abort_parallel() + END IF + END IF + + #endif IF (str1 == TRIM(string)) THEN - READ(str2, *) parsed_string + ! Format specifier is needed for reading paths. Using + ! `*` as format specifier, reading stops at a `/` + READ(str2, '(a)') parsed_string modified = .TRUE. END IF ENDDO diff --git a/templates/classical/online/Makefile b/templates/classical/online/Makefile index 4dffdc566..e115c1d9e 100644 --- a/templates/classical/online/Makefile +++ b/templates/classical/online/Makefile @@ -111,7 +111,7 @@ $(EXE) : libpdaf-d.a \ libpdaf-d.a: @echo "++++++ Generate Filter library ++++++" - @cd $(BASEDIR)/src; make; + @cd $(BASEDIR); make; ###################################################### @@ -132,4 +132,4 @@ clean : cleanpdaf: @echo "+++ Clean up PDAF directory" - cd $(BASEDIR)/src; make clean + cd $(BASEDIR); make clean diff --git a/templates/classical/online/parser_mpi.F90 b/templates/classical/online/parser_mpi.F90 index 61de723e6..6ddcbb65d 100644 --- a/templates/classical/online/parser_mpi.F90 +++ b/templates/classical/online/parser_mpi.F90 @@ -1,65 +1,64 @@ -!$Id: parser_mpi.F90 831 2021-11-06 16:16:30Z lnerger $ -!BOP -! -! !MODULE: +!> Command line parser +!! +!! This module provides routine to parse command line +!! arguments of different types. This version is for +!! use with MPI parallelization. +!! +!! By default, this routine uses the intrinsics +!! 'get_command_count' and 'get_command_argument' +!! that are defined by the Fortran 2003 standard. +!! If a compiler does not support these functions, you +!! can use '-DF77' as a definition for the preprocessor. +!! In this case the Fortran77 standard 'iargc()' and +!! 'getarg()' are used. +!! +!! The module provides a generic subroutine to parse +!! variables of type INTEGER, REAL, or CHARACTER +!! (with length up to 100) from the command line. +!! +!! Usage: +!! SUBROUTINE PARSE(char(len=32) handle, variable) +!! The string 'handle' determines the name of +!! the parsed variable. +!! Example: handle='iters' parses a variable +!! specified on the command line by +!! '-iters value' +!! +!! Usage: +!! CALL PARSE(handle, int_variable) +!! Parses a variable of type integer +!! whose name is given by the string +!! handle. +!! +!! CALL PARSE(handle, real_variable) +!! Parses a variable of type real +!! whose name is given by the string +!! handle. +!! +!! CALL PARSE(handle, character_variable) +!! Parses a string variable of maxmimal +!! length of 100 characters whose name is +!! given by the string handle. +!! +!! CALL PARSE(handle, logical_variable) +!! Parses a variable of type logical +!! whose name is given by the string +!! handle. In the command line it has +!! to be specified as 'T' or 'F'. +!! +!! __Revision history:__ +!! * 2003-02 - Stephan Frickenhaus, Lars Nerger - Initial code +!! * Later revisions - see repository log +!! MODULE parser -! !DESCRIPTION: -! This module provides routine to parse command line -! arguments of different types. This version is for -! use with MPI parallelization. -! By default, this routine uses the intrinsics -! 'get\_command\_count' and 'get\_command\_argument' -! that are define by the Fortran 2003 standard. -! If a compiler does not support these functions, you -! can use '-DF77' as a definition for the preprocessor. -! In this case the Fortran77 standard 'iargc()' and -! 'getarg()' are used. -! -! The module provides a generic subroutine to parse -! variables of type INTEGER, REAL, or CHARACTER -! (with length up to 100) from the command line. -! -! Usage: \begin{verbatim} -! SUBROUTINE PARSE(char(len=32) handle, variable) -! The string 'handle' determines the name of -! the parsed variable. -! Example: handle='iters' parses a variable -! specified on the command line by -! '-iters value' -! -! Usage: -! CALL PARSE(handle, int_variable) -! Parses a variable of type integer -! whose name is given by the string -! handle. -! -! CALL PARSE(handle, real_variable) -! Parses a variable of type real -! whose name is given by the string -! handle. -! -! CALL PARSE(handle, character_variable) -! Parses a string variable of maxmimal -! length of 100 characters whose name is -! given by the string handle. -! -! CALL PARSE(handle, logical_variable) -! Parses a variable of type logical -! whose name is given by the string -! handle. In the command line it has -! to be specified as 'T' or 'F'. -! \end{verbatim} -! -! !REVISION HISTORY: -! 2003-02 - Stephan Frickenhaus, Lars Nerger - Initial code -! Later revisions - see svn log -! -! !USES: - USE mpi + use mpi + USE mod_parallel_model, & + ONLY: abort_parallel + IMPLICIT NONE SAVE - + ! !PUBLIC MEMBER FUNCTIONS: PUBLIC :: parse CHARACTER(len=32), PUBLIC :: handle ! handle for command line parser @@ -190,6 +189,8 @@ SUBROUTINE parse_string(handle, charvalue) ! *** local variables *** CHARACTER(len=100) :: string CHARACTER(len=100) :: parsed_string + CHARACTER(len=110) :: str1_check + CHARACTER(len=110) :: str2_check LOGICAL :: modified ! *** Initialize *** @@ -209,9 +210,27 @@ SUBROUTINE parse_string(handle, charvalue) DO i = 1, command_argument_count() - 1 CALL get_command_argument(i, str1) CALL get_command_argument(i+1, str2) + + ! Add check for inadmissible strings longer than 100 + ! characters + CALL get_command_argument(i, str1_check) + CALL get_command_argument(i+1, str2_check) + IF (mype == 0) THEN + IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN + WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long." + WRITE (*,'(2x, a, 1x, a)') "called handle=", TRIM(string) + WRITE (*,'(2x, a, 1x, a)') "parsed handle=", TRIM(str1) + WRITE (*,'(2x, a, 1x, a)') "parsed input(cut)=", TRIM(str2) + call abort_parallel() + END IF + END IF + + #endif IF (str1 == TRIM(string)) THEN - READ(str2, *) parsed_string + ! Format specifier is needed for reading paths. Using + ! `*` as format specifier, reading stops at a `/` + READ(str2, '(a)') parsed_string modified = .TRUE. END IF ENDDO diff --git a/templates/offline_omi/Makefile b/templates/offline_omi/Makefile index 791f037c0..470d98b62 100644 --- a/templates/offline_omi/Makefile +++ b/templates/offline_omi/Makefile @@ -62,9 +62,7 @@ OBJ_USER_GEN = init_ens_offline.o \ # User-supplied routines for localized analysis OBJ_USER_LOCAL = init_n_domains_pdaf.o \ - init_dim_l_pdaf.o \ - g2l_state_pdaf.o \ - l2g_state_pdaf.o + init_dim_l_pdaf.o # Full list of user-supplied routines for online modes OBJ_PDAF_USER = $(OBJ_USER_PDAFOMI) $(OBJ_USER_GEN) $(OBJ_USER_LOCAL) @@ -84,7 +82,7 @@ $(EXE) : libpdaf-d.a \ libpdaf-d.a: @echo "++++++ Generate Filter library ++++++" - @cd $(BASEDIR)/src; make; + @cd $(BASEDIR); make; ###################################################### @@ -105,4 +103,4 @@ clean : cleanpdaf: @echo "+++ Clean up PDAF directory" - cd $(BASEDIR)/src; make clean + cd $(BASEDIR); make clean diff --git a/templates/offline_omi/assimilate_pdaf_offline.F90 b/templates/offline_omi/assimilate_pdaf_offline.F90 index ea930f4cb..a75f7687f 100644 --- a/templates/offline_omi/assimilate_pdaf_offline.F90 +++ b/templates/offline_omi/assimilate_pdaf_offline.F90 @@ -15,8 +15,10 @@ SUBROUTINE assimilate_pdaf_offline() USE PDAF_interfaces_module, & ! Interface definitions to PDAF core routines - ONLY: PDAFomi_assimilate_local, PDAFomi_assimilate_global, & - PDAFomi_assimilate_lenkf, PDAF_get_localfilter + ONLY: PDAFomi_put_state_global, & + PDAFomi_put_state_lenkf, PDAF_get_localfilter + USE PDAFlocal, & ! Interface definitions for PDAFlocal + ONLY: PDAFlocalomi_put_state USE mod_parallel_pdaf, & ! Parallelization ONLY: mype_world, abort_parallel USE mod_assimilation, & ! Variables for assimilation @@ -43,9 +45,7 @@ SUBROUTINE assimilate_pdaf_offline() prepoststep_ens_offline ! User supplied pre/poststep routine ! Localization of state vector EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains - init_dim_l_pdaf, & ! Initialize state dimension for local analysis domain - g2l_state_pdaf, & ! Get state on local analysis domain from global state - l2g_state_pdaf ! Update global state from state on local analysis domain + init_dim_l_pdaf ! Initialize state dimension for local analysis domain ! Interface to PDAF-OMI for local and global filters EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain @@ -62,7 +62,7 @@ SUBROUTINE assimilate_pdaf_offline() ! *** PDAF_get_state is not required as no forecasting *** ! *** is performed in this mode. However, it is save *** ! *** to call PDAF_get_state, even it is not necessary. *** -! *** The functionality of PDAF_get_state is deactived *** +! *** The functionality of PDAF_get_state is deactivated *** ! *** for the offline mode. *** ! Check whether the filter is domain-localized @@ -71,18 +71,18 @@ SUBROUTINE assimilate_pdaf_offline() ! Call assimilate routine for global or local filter IF (localfilter == 1) THEN ! Call generic OMI interface routine for domain-localized filters - CALL PDAFomi_put_state_local(collect_state_pdaf, init_dim_obs_pdafomi, & + CALL PDAFlocalomi_put_state(collect_state_pdaf, init_dim_obs_pdafomi, & obs_op_pdafomi, prepoststep_ens_offline, init_n_domains_pdaf, init_dim_l_pdaf, & - init_dim_obs_l_pdafomi, g2l_state_pdaf, l2g_state_pdaf, status_pdaf) + init_dim_obs_l_pdafomi, status_pdaf) ELSE - IF (filtertype == 8) THEN - ! LEnKF has its own OMI interface routine - CALL PDAFomi_put_state_lenkf(collect_state_pdaf, init_dim_obs_pdafomi, & - obs_op_pdafomi, prepoststep_ens_offline, localize_covar_pdafomi, status_pdaf) - ELSE + IF (filtertype /= 8) THEN ! Call generic OMI interface routine for global filters CALL PDAFomi_put_state_global(collect_state_pdaf, init_dim_obs_pdafomi, & obs_op_pdafomi, prepoststep_ens_offline, status_pdaf) + ELSE + ! LEnKF has its own OMI interface routine + CALL PDAFomi_put_state_lenkf(collect_state_pdaf, init_dim_obs_pdafomi, & + obs_op_pdafomi, prepoststep_ens_offline, localize_covar_pdafomi, status_pdaf) END IF END IF diff --git a/templates/offline_omi/g2l_state_pdaf.F90 b/templates/offline_omi/g2l_state_pdaf.F90 deleted file mode 100644 index 177740d1a..000000000 --- a/templates/offline_omi/g2l_state_pdaf.F90 +++ /dev/null @@ -1,49 +0,0 @@ -!> Restrict a model state to a local analysis domain -!! -!! User-supplied call-back routine for PDAF. -!! -!! Used in the filters: LSEIK/LETKF/LESTKF/LNETF -!! -!! The routine is called during the loop over all -!! local analysis domains in PDAF_X_update -!! before the analysis on a single local analysis -!! domain. It has to initialize elements of the -!! state vector for the local analysis domains from -!! the PE-local full state vector. -!! -!! Generic implementation using index vector -!! ID_LSTATE_IN_PSTATE. -!! -!! __Revision history:__ -!! * 2013-02 - Lars Nerger - Initial code -!! * Later revisions - see repository log -!! -SUBROUTINE g2l_state_pdaf(step, domain_p, dim_p, state_p, dim_l, state_l) - - USE mod_assimilation, & - ONLY: id_lstate_in_pstate - - IMPLICIT NONE - -! *** Arguments *** - INTEGER, INTENT(in) :: step !< Current time step - INTEGER, INTENT(in) :: domain_p !< Current local analysis domain - INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension - INTEGER, INTENT(in) :: dim_l !< Local state dimension - REAL, INTENT(in) :: state_p(dim_p) !< PE-local full state vector - REAL, INTENT(out) :: state_l(dim_l) !< State vector on local analysis domain - -! *** local variables *** - INTEGER :: i ! Counter - - -! ************************************* -! *** Initialize local state vector *** -! ************************************* - - ! Generic initialization using ID_LSTATE_IN_PSTATE set in INIT_DIM_L_PDAF - DO i = 1, dim_l - state_l(i) = state_p(id_lstate_in_pstate(i)) - END DO - -END SUBROUTINE g2l_state_pdaf diff --git a/templates/offline_omi/init_dim_l_pdaf.F90 b/templates/offline_omi/init_dim_l_pdaf.F90 index 13245a69c..1d81fdb09 100644 --- a/templates/offline_omi/init_dim_l_pdaf.F90 +++ b/templates/offline_omi/init_dim_l_pdaf.F90 @@ -11,13 +11,15 @@ !! domain. !! !! __Revision history:__ -!! * 2013-02 - Lars Nerger - Initial code +!! * 2005-09 - Lars Nerger - Initial code !! * Later revisions - see repository log !! SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) + USE PDAFlocal, & ! Routine to provide local indices to PDAF + ONLY: PDAFlocal_set_indices USE mod_assimilation, & ! Variables for assimilation - ONLY: coords_l, id_lstate_in_pstate + ONLY: coords_l IMPLICIT NONE @@ -26,6 +28,9 @@ SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) INTEGER, INTENT(in) :: domain_p !< Current local analysis domain INTEGER, INTENT(out) :: dim_l !< Local state dimension +! *** local variables *** + INTEGER, ALLOCATABLE :: id_lstate_in_pstate(:) ! Indices of local state vector in PE-local global state vector + ! **************************************** ! *** Initialize local state dimension *** @@ -52,9 +57,14 @@ SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) ! ****************************************************** ! Allocate array - IF (ALLOCATED(id_lstate_in_pstate)) DEALLOCATE(id_lstate_in_pstate) ALLOCATE(id_lstate_in_pstate(dim_l)) ! id_lstate_in_pstate = ?? + ! Provide the index vector to PDAF + CALL PDAFlocal_set_indices(dim_l, id_lstate_in_pstate) + + ! Deallocate index array + DEALLOCATE(id_lstate_in_pstate) + END SUBROUTINE init_dim_l_pdaf diff --git a/templates/offline_omi/l2g_state_pdaf.F90 b/templates/offline_omi/l2g_state_pdaf.F90 deleted file mode 100644 index 1a27e44f2..000000000 --- a/templates/offline_omi/l2g_state_pdaf.F90 +++ /dev/null @@ -1,50 +0,0 @@ -!> Initialize full state from local analysis -!! -!! User-supplied call-back routine for PDAF. -!! -!! Used in the filters: LSEIK/LETKF/LESTKF/LNETF -!! -!! The routine is called during the loop over all -!! local analysis domains in PDAF_X_update -!! after the analysis and ensemble transformation -!! on a single local analysis domain. It has to -!! initialize elements of the PE-local full state -!! vector from the provided analysis state vector -!! on the local analysis domain. -!! -!! Generic implementation using index vector -!! ID_LSTATE_IN_PSTATE. -!! -!! __Revision history:__ -!! * 2013-02 - Lars Nerger - Initial code -!! * Later revisions - see repository log -!! -SUBROUTINE l2g_state_pdaf(step, domain_p, dim_l, state_l, dim_p, state_p) - - USE mod_assimilation, & - ONLY: id_lstate_in_pstate - - IMPLICIT NONE - -! *** Arguments *** - INTEGER, INTENT(in) :: step !< Current time step - INTEGER, INTENT(in) :: domain_p !< Current local analysis domain - INTEGER, INTENT(in) :: dim_l !< Local state dimension - INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension - REAL, INTENT(in) :: state_l(dim_l) !< State vector on local analysis domain - REAL, INTENT(inout) :: state_p(dim_p) !< PE-local full state vector - -! *** local variables *** - INTEGER :: i ! Counter - - -! ************************************************** -! *** Initialize elements of global state vector *** -! ************************************************** - - ! Generic initialization using ID_LSTATE_IN_PSTATE set in INIT_DIM_L_PDAF - DO i = 1, dim_l - state_p(id_lstate_in_pstate(i)) = state_l(i) - END DO - -END SUBROUTINE l2g_state_pdaf diff --git a/templates/offline_omi/mod_assimilation.F90 b/templates/offline_omi/mod_assimilation.F90 index 9d62dea0f..bda8d8a6c 100644 --- a/templates/offline_omi/mod_assimilation.F90 +++ b/templates/offline_omi/mod_assimilation.F90 @@ -21,7 +21,6 @@ MODULE mod_assimilation ! *** Variables specific for model setup *** REAL :: coords_l(2) !< Coordinates of local analysis domain - INTEGER, ALLOCATABLE :: id_lstate_in_pstate(:) !< Indices of local state vector in PE-local global state vector ! Variables to handle multiple fields in the state vector INTEGER :: n_fields !< number of fields in state vector @@ -39,7 +38,7 @@ MODULE mod_assimilation ! Type variable holding field IDs in state vector TYPE(field_ids) :: id -!$OMP THREADPRIVATE(coords_l, id_lstate_in_pstate) +!$OMP THREADPRIVATE(coords_l) ! ----------------------------------------------------------------- @@ -64,18 +63,12 @@ MODULE mod_assimilation !< * (1) progress info !< * (2) add timings !< * (3) debugging output - INTEGER :: dim_ens !< Size of ensemble for SEIK/LSEIK/EnKF/ETKF \n - !< Number of EOFs to be used for SEEK + INTEGER :: dim_ens !< Size of ensemble INTEGER :: filtertype !< Select filter algorithm: - !< * SEEK (0), SEIK (1), EnKF (2), LSEIK (3), ETKF (4) + !< * SEIK (1), EnKF (2), LSEIK (3), ETKF (4) !< LETKF (5), ESTKF (6), LESTKF (7), NETF (9), LNETF (10) !< LKNETF (11), PF (12), GENOBS (100), 3DVAR (200) INTEGER :: subtype !< Subtype of filter algorithm - !< * SEEK: - !< (0) evolve normalized modes - !< (1) evolve scaled modes with unit U - !< (2) fixed basis (V); variable U matrix - !< (3) fixed covar matrix (V,U kept static) !< * SEIK: !< (0) ensemble forecast; new formulation !< (1) ensemble forecast; old formulation @@ -149,9 +142,6 @@ MODULE mod_assimilation !< (4) regulated localization of R with single-point error variance REAL :: sradius !< Support radius for 5th order polynomial !< or radius for 1/e for exponential weighting -! ! SEEK - INTEGER :: int_rediag !< Interval to perform re-diagonalization in SEEK - REAL :: epsilon !< Epsilon for gradient approx. in SEEK forecast ! ! ENKF INTEGER :: rank_ana_enkf !< Rank to be considered for inversion of HPH in analysis of EnKF !< (0) for analysis w/o eigendecomposition diff --git a/templates/offline_omi/parser_mpi.F90 b/templates/offline_omi/parser_mpi.F90 index 4269eed43..0b814ab44 100644 --- a/templates/offline_omi/parser_mpi.F90 +++ b/templates/offline_omi/parser_mpi.F90 @@ -53,6 +53,8 @@ MODULE parser use mpi + USE mod_parallel_pdaf, & + ONLY: abort_parallel IMPLICIT NONE SAVE @@ -187,6 +189,8 @@ SUBROUTINE parse_string(handle, charvalue) ! *** local variables *** CHARACTER(len=100) :: string CHARACTER(len=100) :: parsed_string + CHARACTER(len=110) :: str1_check + CHARACTER(len=110) :: str2_check LOGICAL :: modified ! *** Initialize *** @@ -206,9 +210,27 @@ SUBROUTINE parse_string(handle, charvalue) DO i = 1, command_argument_count() - 1 CALL get_command_argument(i, str1) CALL get_command_argument(i+1, str2) + + ! Add check for inadmissible strings longer than 100 + ! characters + CALL get_command_argument(i, str1_check) + CALL get_command_argument(i+1, str2_check) + IF (mype == 0) THEN + IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN + WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long." + WRITE (*,'(2x, a, 1x, a)') "called handle=", TRIM(string) + WRITE (*,'(2x, a, 1x, a)') "parsed handle=", TRIM(str1) + WRITE (*,'(2x, a, 1x, a)') "parsed input(cut)=", TRIM(str2) + call abort_parallel() + END IF + END IF + + #endif IF (str1 == TRIM(string)) THEN - READ(str2, *) parsed_string + ! Format specifier is needed for reading paths. Using + ! `*` as format specifier, reading stops at a `/` + READ(str2, '(a)') parsed_string modified = .TRUE. END IF ENDDO diff --git a/templates/online_omi/Makefile b/templates/online_omi/Makefile index 6492ebe1a..e1871f108 100644 --- a/templates/online_omi/Makefile +++ b/templates/online_omi/Makefile @@ -31,15 +31,15 @@ EXE = PDAF_online .SUFFIXES: .F90 .o # Modules used for the model part -MODULES = mod_model.o \ +MODULES = mod_parallel_pdaf.o \ + mod_model.o \ parser_mpi.o # Model routines OBJ_MODEL = main.o # Moduls used for PDAF -MOD_ASSIM = mod_parallel_pdaf.o \ - mod_assimilation.o +MOD_ASSIM = mod_assimilation.o # Routines of observation handling (PDAF-OMI) OBJ_USER_PDAFOMI = obs_OBSTYPE_pdafomi_TEMPLATE.o \ @@ -89,7 +89,7 @@ $(EXE) : libpdaf-d.a \ libpdaf-d.a: @echo "++++++ Generate Filter library ++++++" - @cd $(BASEDIR)/src; make; + @cd $(BASEDIR); make; ###################################################### @@ -110,4 +110,4 @@ clean : cleanpdaf: @echo "+++ Clean up PDAF directory" - cd $(BASEDIR)/src; make clean + cd $(BASEDIR); make clean diff --git a/templates/online_omi/assimilate_pdaf.F90 b/templates/online_omi/assimilate_pdaf.F90 index b6c9dd3f1..318c0e6d6 100644 --- a/templates/online_omi/assimilate_pdaf.F90 +++ b/templates/online_omi/assimilate_pdaf.F90 @@ -5,15 +5,20 @@ !! (PDAFomi_assimilate_X), which checks whether the forecast phase !! is completed. If so, the analysis step is computed inside PDAF. !! +!! In this routine, the real names of most of the +!! user-supplied routines for PDAF are specified (see below). +!! !! __Revision history:__ !! * 2020-11 - Lars Nerger - Initial code for OMI !! * Later revisions - see repository log !! SUBROUTINE assimilate_pdaf() - USE pdaf_interfaces_module, & ! Interface definitions to PDAF core routines - ONLY: PDAFomi_assimilate_local, PDAFomi_assimilate_global, & + USE PDAF_interfaces_module, & ! Interface definitions to PDAF core routines + ONLY: PDAFomi_assimilate_global, & PDAFomi_assimilate_lenkf, PDAF_get_localfilter, PDAFomi_generate_obs + USE PDAFlocal, & ! Interface definitions for PDAFlocal + ONLY: PDAFlocalomi_assimilate USE mod_parallel_pdaf, & ! Parallelization variables ONLY: mype_world, abort_parallel USE mod_assimilation, & ! Variables for assimilation @@ -40,9 +45,7 @@ SUBROUTINE assimilate_pdaf() prepoststep_pdaf ! User supplied pre/poststep routine ! Localization of state vector EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains - init_dim_l_pdaf, & ! Initialize state dimension for local analysis domain - g2l_state_pdaf, & ! Get state on local analysis domain from global state - l2g_state_pdaf ! Update global state from state on local analysis domain + init_dim_l_pdaf ! Initialize state dimension for local analysis domain ! Interface to PDAF-OMI for local and global filters EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain @@ -62,10 +65,9 @@ SUBROUTINE assimilate_pdaf() ! Call assimilate routine for global or local filter IF (localfilter == 1) THEN ! Call generic OMI interface routine for domain-localized filters - CALL PDAFomi_assimilate_local(collect_state_pdaf, distribute_state_pdaf, & + CALL PDAFlocalomi_assimilate(collect_state_pdaf, distribute_state_pdaf, & init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & - init_dim_l_pdaf, init_dim_obs_l_pdafomi, g2l_state_pdaf, l2g_state_pdaf, & - next_observation_pdaf, status_pdaf) + init_dim_l_pdaf, init_dim_obs_l_pdafomi, next_observation_pdaf, status_pdaf) ELSE IF (filtertype == 8) THEN ! LEnKF has its own OMI interface routine diff --git a/templates/online_omi/g2l_state_pdaf.F90 b/templates/online_omi/g2l_state_pdaf.F90 deleted file mode 100644 index 177740d1a..000000000 --- a/templates/online_omi/g2l_state_pdaf.F90 +++ /dev/null @@ -1,49 +0,0 @@ -!> Restrict a model state to a local analysis domain -!! -!! User-supplied call-back routine for PDAF. -!! -!! Used in the filters: LSEIK/LETKF/LESTKF/LNETF -!! -!! The routine is called during the loop over all -!! local analysis domains in PDAF_X_update -!! before the analysis on a single local analysis -!! domain. It has to initialize elements of the -!! state vector for the local analysis domains from -!! the PE-local full state vector. -!! -!! Generic implementation using index vector -!! ID_LSTATE_IN_PSTATE. -!! -!! __Revision history:__ -!! * 2013-02 - Lars Nerger - Initial code -!! * Later revisions - see repository log -!! -SUBROUTINE g2l_state_pdaf(step, domain_p, dim_p, state_p, dim_l, state_l) - - USE mod_assimilation, & - ONLY: id_lstate_in_pstate - - IMPLICIT NONE - -! *** Arguments *** - INTEGER, INTENT(in) :: step !< Current time step - INTEGER, INTENT(in) :: domain_p !< Current local analysis domain - INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension - INTEGER, INTENT(in) :: dim_l !< Local state dimension - REAL, INTENT(in) :: state_p(dim_p) !< PE-local full state vector - REAL, INTENT(out) :: state_l(dim_l) !< State vector on local analysis domain - -! *** local variables *** - INTEGER :: i ! Counter - - -! ************************************* -! *** Initialize local state vector *** -! ************************************* - - ! Generic initialization using ID_LSTATE_IN_PSTATE set in INIT_DIM_L_PDAF - DO i = 1, dim_l - state_l(i) = state_p(id_lstate_in_pstate(i)) - END DO - -END SUBROUTINE g2l_state_pdaf diff --git a/templates/online_omi/init_dim_l_pdaf.F90 b/templates/online_omi/init_dim_l_pdaf.F90 index 43a9c70cc..1d81fdb09 100644 --- a/templates/online_omi/init_dim_l_pdaf.F90 +++ b/templates/online_omi/init_dim_l_pdaf.F90 @@ -16,8 +16,10 @@ !! SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) + USE PDAFlocal, & ! Routine to provide local indices to PDAF + ONLY: PDAFlocal_set_indices USE mod_assimilation, & ! Variables for assimilation - ONLY: coords_l, id_lstate_in_pstate + ONLY: coords_l IMPLICIT NONE @@ -26,6 +28,9 @@ SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) INTEGER, INTENT(in) :: domain_p !< Current local analysis domain INTEGER, INTENT(out) :: dim_l !< Local state dimension +! *** local variables *** + INTEGER, ALLOCATABLE :: id_lstate_in_pstate(:) ! Indices of local state vector in PE-local global state vector + ! **************************************** ! *** Initialize local state dimension *** @@ -52,9 +57,14 @@ SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) ! ****************************************************** ! Allocate array - IF (ALLOCATED(id_lstate_in_pstate)) DEALLOCATE(id_lstate_in_pstate) ALLOCATE(id_lstate_in_pstate(dim_l)) ! id_lstate_in_pstate = ?? + ! Provide the index vector to PDAF + CALL PDAFlocal_set_indices(dim_l, id_lstate_in_pstate) + + ! Deallocate index array + DEALLOCATE(id_lstate_in_pstate) + END SUBROUTINE init_dim_l_pdaf diff --git a/templates/online_omi/l2g_state_pdaf.F90 b/templates/online_omi/l2g_state_pdaf.F90 deleted file mode 100644 index 1a27e44f2..000000000 --- a/templates/online_omi/l2g_state_pdaf.F90 +++ /dev/null @@ -1,50 +0,0 @@ -!> Initialize full state from local analysis -!! -!! User-supplied call-back routine for PDAF. -!! -!! Used in the filters: LSEIK/LETKF/LESTKF/LNETF -!! -!! The routine is called during the loop over all -!! local analysis domains in PDAF_X_update -!! after the analysis and ensemble transformation -!! on a single local analysis domain. It has to -!! initialize elements of the PE-local full state -!! vector from the provided analysis state vector -!! on the local analysis domain. -!! -!! Generic implementation using index vector -!! ID_LSTATE_IN_PSTATE. -!! -!! __Revision history:__ -!! * 2013-02 - Lars Nerger - Initial code -!! * Later revisions - see repository log -!! -SUBROUTINE l2g_state_pdaf(step, domain_p, dim_l, state_l, dim_p, state_p) - - USE mod_assimilation, & - ONLY: id_lstate_in_pstate - - IMPLICIT NONE - -! *** Arguments *** - INTEGER, INTENT(in) :: step !< Current time step - INTEGER, INTENT(in) :: domain_p !< Current local analysis domain - INTEGER, INTENT(in) :: dim_l !< Local state dimension - INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension - REAL, INTENT(in) :: state_l(dim_l) !< State vector on local analysis domain - REAL, INTENT(inout) :: state_p(dim_p) !< PE-local full state vector - -! *** local variables *** - INTEGER :: i ! Counter - - -! ************************************************** -! *** Initialize elements of global state vector *** -! ************************************************** - - ! Generic initialization using ID_LSTATE_IN_PSTATE set in INIT_DIM_L_PDAF - DO i = 1, dim_l - state_p(id_lstate_in_pstate(i)) = state_l(i) - END DO - -END SUBROUTINE l2g_state_pdaf diff --git a/templates/online_omi/mod_assimilation.F90 b/templates/online_omi/mod_assimilation.F90 index 9d62dea0f..1b0e51f25 100644 --- a/templates/online_omi/mod_assimilation.F90 +++ b/templates/online_omi/mod_assimilation.F90 @@ -21,9 +21,9 @@ MODULE mod_assimilation ! *** Variables specific for model setup *** REAL :: coords_l(2) !< Coordinates of local analysis domain - INTEGER, ALLOCATABLE :: id_lstate_in_pstate(:) !< Indices of local state vector in PE-local global state vector - ! Variables to handle multiple fields in the state vector +! *** Variables to handle multiple fields in the state vector *** + INTEGER :: n_fields !< number of fields in state vector INTEGER, ALLOCATABLE :: off_fields(:) !< Offsets of fields in state vector INTEGER, ALLOCATABLE :: dim_fields(:) !< Dimension of fields in state vector @@ -39,7 +39,7 @@ MODULE mod_assimilation ! Type variable holding field IDs in state vector TYPE(field_ids) :: id -!$OMP THREADPRIVATE(coords_l, id_lstate_in_pstate) +!$OMP THREADPRIVATE(coords_l) ! ----------------------------------------------------------------- @@ -64,18 +64,12 @@ MODULE mod_assimilation !< * (1) progress info !< * (2) add timings !< * (3) debugging output - INTEGER :: dim_ens !< Size of ensemble for SEIK/LSEIK/EnKF/ETKF \n - !< Number of EOFs to be used for SEEK + INTEGER :: dim_ens !< Size of ensemble INTEGER :: filtertype !< Select filter algorithm: - !< * SEEK (0), SEIK (1), EnKF (2), LSEIK (3), ETKF (4) + !< * SEIK (1), EnKF (2), LSEIK (3), ETKF (4) !< LETKF (5), ESTKF (6), LESTKF (7), NETF (9), LNETF (10) !< LKNETF (11), PF (12), GENOBS (100), 3DVAR (200) INTEGER :: subtype !< Subtype of filter algorithm - !< * SEEK: - !< (0) evolve normalized modes - !< (1) evolve scaled modes with unit U - !< (2) fixed basis (V); variable U matrix - !< (3) fixed covar matrix (V,U kept static) !< * SEIK: !< (0) ensemble forecast; new formulation !< (1) ensemble forecast; old formulation @@ -149,9 +143,6 @@ MODULE mod_assimilation !< (4) regulated localization of R with single-point error variance REAL :: sradius !< Support radius for 5th order polynomial !< or radius for 1/e for exponential weighting -! ! SEEK - INTEGER :: int_rediag !< Interval to perform re-diagonalization in SEEK - REAL :: epsilon !< Epsilon for gradient approx. in SEEK forecast ! ! ENKF INTEGER :: rank_ana_enkf !< Rank to be considered for inversion of HPH in analysis of EnKF !< (0) for analysis w/o eigendecomposition diff --git a/templates/online_omi/parser_mpi.F90 b/templates/online_omi/parser_mpi.F90 index 4269eed43..0b814ab44 100644 --- a/templates/online_omi/parser_mpi.F90 +++ b/templates/online_omi/parser_mpi.F90 @@ -53,6 +53,8 @@ MODULE parser use mpi + USE mod_parallel_pdaf, & + ONLY: abort_parallel IMPLICIT NONE SAVE @@ -187,6 +189,8 @@ SUBROUTINE parse_string(handle, charvalue) ! *** local variables *** CHARACTER(len=100) :: string CHARACTER(len=100) :: parsed_string + CHARACTER(len=110) :: str1_check + CHARACTER(len=110) :: str2_check LOGICAL :: modified ! *** Initialize *** @@ -206,9 +210,27 @@ SUBROUTINE parse_string(handle, charvalue) DO i = 1, command_argument_count() - 1 CALL get_command_argument(i, str1) CALL get_command_argument(i+1, str2) + + ! Add check for inadmissible strings longer than 100 + ! characters + CALL get_command_argument(i, str1_check) + CALL get_command_argument(i+1, str2_check) + IF (mype == 0) THEN + IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN + WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long." + WRITE (*,'(2x, a, 1x, a)') "called handle=", TRIM(string) + WRITE (*,'(2x, a, 1x, a)') "parsed handle=", TRIM(str1) + WRITE (*,'(2x, a, 1x, a)') "parsed input(cut)=", TRIM(str2) + call abort_parallel() + END IF + END IF + + #endif IF (str1 == TRIM(string)) THEN - READ(str2, *) parsed_string + ! Format specifier is needed for reading paths. Using + ! `*` as format specifier, reading stops at a `/` + READ(str2, '(a)') parsed_string modified = .TRUE. END IF ENDDO diff --git a/templates/online_omi_flexible/Makefile b/templates/online_omi_flexible/Makefile index c33305e6e..78fdfa6ae 100644 --- a/templates/online_omi_flexible/Makefile +++ b/templates/online_omi_flexible/Makefile @@ -31,15 +31,15 @@ EXE = PDAF_online .SUFFIXES: .F90 .o # Modules used for the model part -MODULES = mod_model.o \ +MODULES = mod_parallel_pdaf.o \ + mod_model.o \ parser_mpi.o # Model routines OBJ_MODEL = main.o # Moduls used for PDAF -MOD_ASSIM = mod_parallel_pdaf.o \ - mod_assimilation.o +MOD_ASSIM = mod_assimilation.o # Routines of observation handling (PDAF-OMI) OBJ_USER_PDAFOMI = obs_OBSTYPE_pdafomi_TEMPLATE.o \ @@ -62,9 +62,7 @@ OBJ_USER_GEN = init_ens_pdaf.o \ # User-supplied routines for localized analysis OBJ_USER_LOCAL = init_n_domains_pdaf.o \ - init_dim_l_pdaf.o \ - g2l_state_pdaf.o \ - l2g_state_pdaf.o + init_dim_l_pdaf.o # Full list of user-supplied routines for online modes OBJ_PDAF_USER = $(OBJ_USER_PDAFOMI) $(OBJ_PDAF_INT) $(OBJ_USER_GEN) $(OBJ_USER_LOCAL) @@ -88,7 +86,7 @@ $(EXE) : libpdaf-d.a \ libpdaf-d.a: @echo "++++++ Generate Filter library ++++++" - @cd $(BASEDIR)/src; make; + @cd $(BASEDIR); make; ###################################################### @@ -109,4 +107,4 @@ clean : cleanpdaf: @echo "+++ Clean up PDAF directory" - cd $(BASEDIR)/src; make clean + cd $(BASEDIR); make clean diff --git a/templates/online_omi_flexible/assimilate_pdaf.F90 b/templates/online_omi_flexible/assimilate_pdaf.F90 index 2a00e7210..d9f5d0eba 100644 --- a/templates/online_omi_flexible/assimilate_pdaf.F90 +++ b/templates/online_omi_flexible/assimilate_pdaf.F90 @@ -15,6 +15,8 @@ SUBROUTINE assimilate_pdaf() USE pdaf_interfaces_module, & ! Interface definitions to PDAF core routines ONLY: PDAFomi_put_state_local, PDAFomi_put_state_global, & PDAFomi_put_state_lenkf, PDAF_get_localfilter, PDAFomi_generate_obs + USE PDAFlocal, & ! Interface definitions for PDAFlocal + ONLY: PDAFlocalomi_put_state USE mod_parallel_pdaf, & ! Parallelization variables ONLY: mype_world, abort_parallel USE mod_assimilation, & ! Variables for assimilation @@ -39,9 +41,7 @@ SUBROUTINE assimilate_pdaf() prepoststep_pdaf ! User supplied pre/poststep routine ! Localization of state vector EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains - init_dim_l_pdaf, & ! Initialize state dimension for local analysis domain - g2l_state_pdaf, & ! Get state on local analysis domain from global state - l2g_state_pdaf ! Update global state from state on local analysis domain + init_dim_l_pdaf ! Initialize state dimension for local analysis domain ! Interface to PDAF-OMI for local and global filters EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain @@ -59,9 +59,9 @@ SUBROUTINE assimilate_pdaf() ! Call assimilate routine for global or local filter IF (localfilter == 1) THEN ! Call generic OMI interface routine for domain-localized filters - CALL PDAFomi_put_state_local(collect_state_pdaf, init_dim_obs_pdafomi, & + CALL PDAFlocalomi_put_state(collect_state_pdaf, init_dim_obs_pdafomi, & obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, init_dim_l_pdaf, & - init_dim_obs_l_pdafomi, g2l_state_pdaf, l2g_state_pdaf, status_pdaf) + init_dim_obs_l_pdafomi, status_pdaf) ELSE IF (filtertype == 8) THEN ! LEnKF has its own OMI interface routine diff --git a/templates/online_omi_flexible/g2l_state_pdaf.F90 b/templates/online_omi_flexible/g2l_state_pdaf.F90 deleted file mode 100644 index 177740d1a..000000000 --- a/templates/online_omi_flexible/g2l_state_pdaf.F90 +++ /dev/null @@ -1,49 +0,0 @@ -!> Restrict a model state to a local analysis domain -!! -!! User-supplied call-back routine for PDAF. -!! -!! Used in the filters: LSEIK/LETKF/LESTKF/LNETF -!! -!! The routine is called during the loop over all -!! local analysis domains in PDAF_X_update -!! before the analysis on a single local analysis -!! domain. It has to initialize elements of the -!! state vector for the local analysis domains from -!! the PE-local full state vector. -!! -!! Generic implementation using index vector -!! ID_LSTATE_IN_PSTATE. -!! -!! __Revision history:__ -!! * 2013-02 - Lars Nerger - Initial code -!! * Later revisions - see repository log -!! -SUBROUTINE g2l_state_pdaf(step, domain_p, dim_p, state_p, dim_l, state_l) - - USE mod_assimilation, & - ONLY: id_lstate_in_pstate - - IMPLICIT NONE - -! *** Arguments *** - INTEGER, INTENT(in) :: step !< Current time step - INTEGER, INTENT(in) :: domain_p !< Current local analysis domain - INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension - INTEGER, INTENT(in) :: dim_l !< Local state dimension - REAL, INTENT(in) :: state_p(dim_p) !< PE-local full state vector - REAL, INTENT(out) :: state_l(dim_l) !< State vector on local analysis domain - -! *** local variables *** - INTEGER :: i ! Counter - - -! ************************************* -! *** Initialize local state vector *** -! ************************************* - - ! Generic initialization using ID_LSTATE_IN_PSTATE set in INIT_DIM_L_PDAF - DO i = 1, dim_l - state_l(i) = state_p(id_lstate_in_pstate(i)) - END DO - -END SUBROUTINE g2l_state_pdaf diff --git a/templates/online_omi_flexible/init_dim_l_pdaf.F90 b/templates/online_omi_flexible/init_dim_l_pdaf.F90 index 43a9c70cc..1d81fdb09 100644 --- a/templates/online_omi_flexible/init_dim_l_pdaf.F90 +++ b/templates/online_omi_flexible/init_dim_l_pdaf.F90 @@ -16,8 +16,10 @@ !! SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) + USE PDAFlocal, & ! Routine to provide local indices to PDAF + ONLY: PDAFlocal_set_indices USE mod_assimilation, & ! Variables for assimilation - ONLY: coords_l, id_lstate_in_pstate + ONLY: coords_l IMPLICIT NONE @@ -26,6 +28,9 @@ SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) INTEGER, INTENT(in) :: domain_p !< Current local analysis domain INTEGER, INTENT(out) :: dim_l !< Local state dimension +! *** local variables *** + INTEGER, ALLOCATABLE :: id_lstate_in_pstate(:) ! Indices of local state vector in PE-local global state vector + ! **************************************** ! *** Initialize local state dimension *** @@ -52,9 +57,14 @@ SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) ! ****************************************************** ! Allocate array - IF (ALLOCATED(id_lstate_in_pstate)) DEALLOCATE(id_lstate_in_pstate) ALLOCATE(id_lstate_in_pstate(dim_l)) ! id_lstate_in_pstate = ?? + ! Provide the index vector to PDAF + CALL PDAFlocal_set_indices(dim_l, id_lstate_in_pstate) + + ! Deallocate index array + DEALLOCATE(id_lstate_in_pstate) + END SUBROUTINE init_dim_l_pdaf diff --git a/templates/online_omi_flexible/l2g_state_pdaf.F90 b/templates/online_omi_flexible/l2g_state_pdaf.F90 deleted file mode 100644 index 1a27e44f2..000000000 --- a/templates/online_omi_flexible/l2g_state_pdaf.F90 +++ /dev/null @@ -1,50 +0,0 @@ -!> Initialize full state from local analysis -!! -!! User-supplied call-back routine for PDAF. -!! -!! Used in the filters: LSEIK/LETKF/LESTKF/LNETF -!! -!! The routine is called during the loop over all -!! local analysis domains in PDAF_X_update -!! after the analysis and ensemble transformation -!! on a single local analysis domain. It has to -!! initialize elements of the PE-local full state -!! vector from the provided analysis state vector -!! on the local analysis domain. -!! -!! Generic implementation using index vector -!! ID_LSTATE_IN_PSTATE. -!! -!! __Revision history:__ -!! * 2013-02 - Lars Nerger - Initial code -!! * Later revisions - see repository log -!! -SUBROUTINE l2g_state_pdaf(step, domain_p, dim_l, state_l, dim_p, state_p) - - USE mod_assimilation, & - ONLY: id_lstate_in_pstate - - IMPLICIT NONE - -! *** Arguments *** - INTEGER, INTENT(in) :: step !< Current time step - INTEGER, INTENT(in) :: domain_p !< Current local analysis domain - INTEGER, INTENT(in) :: dim_l !< Local state dimension - INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension - REAL, INTENT(in) :: state_l(dim_l) !< State vector on local analysis domain - REAL, INTENT(inout) :: state_p(dim_p) !< PE-local full state vector - -! *** local variables *** - INTEGER :: i ! Counter - - -! ************************************************** -! *** Initialize elements of global state vector *** -! ************************************************** - - ! Generic initialization using ID_LSTATE_IN_PSTATE set in INIT_DIM_L_PDAF - DO i = 1, dim_l - state_p(id_lstate_in_pstate(i)) = state_l(i) - END DO - -END SUBROUTINE l2g_state_pdaf diff --git a/templates/online_omi_flexible/mod_assimilation.F90 b/templates/online_omi_flexible/mod_assimilation.F90 index 9d62dea0f..1b0e51f25 100644 --- a/templates/online_omi_flexible/mod_assimilation.F90 +++ b/templates/online_omi_flexible/mod_assimilation.F90 @@ -21,9 +21,9 @@ MODULE mod_assimilation ! *** Variables specific for model setup *** REAL :: coords_l(2) !< Coordinates of local analysis domain - INTEGER, ALLOCATABLE :: id_lstate_in_pstate(:) !< Indices of local state vector in PE-local global state vector - ! Variables to handle multiple fields in the state vector +! *** Variables to handle multiple fields in the state vector *** + INTEGER :: n_fields !< number of fields in state vector INTEGER, ALLOCATABLE :: off_fields(:) !< Offsets of fields in state vector INTEGER, ALLOCATABLE :: dim_fields(:) !< Dimension of fields in state vector @@ -39,7 +39,7 @@ MODULE mod_assimilation ! Type variable holding field IDs in state vector TYPE(field_ids) :: id -!$OMP THREADPRIVATE(coords_l, id_lstate_in_pstate) +!$OMP THREADPRIVATE(coords_l) ! ----------------------------------------------------------------- @@ -64,18 +64,12 @@ MODULE mod_assimilation !< * (1) progress info !< * (2) add timings !< * (3) debugging output - INTEGER :: dim_ens !< Size of ensemble for SEIK/LSEIK/EnKF/ETKF \n - !< Number of EOFs to be used for SEEK + INTEGER :: dim_ens !< Size of ensemble INTEGER :: filtertype !< Select filter algorithm: - !< * SEEK (0), SEIK (1), EnKF (2), LSEIK (3), ETKF (4) + !< * SEIK (1), EnKF (2), LSEIK (3), ETKF (4) !< LETKF (5), ESTKF (6), LESTKF (7), NETF (9), LNETF (10) !< LKNETF (11), PF (12), GENOBS (100), 3DVAR (200) INTEGER :: subtype !< Subtype of filter algorithm - !< * SEEK: - !< (0) evolve normalized modes - !< (1) evolve scaled modes with unit U - !< (2) fixed basis (V); variable U matrix - !< (3) fixed covar matrix (V,U kept static) !< * SEIK: !< (0) ensemble forecast; new formulation !< (1) ensemble forecast; old formulation @@ -149,9 +143,6 @@ MODULE mod_assimilation !< (4) regulated localization of R with single-point error variance REAL :: sradius !< Support radius for 5th order polynomial !< or radius for 1/e for exponential weighting -! ! SEEK - INTEGER :: int_rediag !< Interval to perform re-diagonalization in SEEK - REAL :: epsilon !< Epsilon for gradient approx. in SEEK forecast ! ! ENKF INTEGER :: rank_ana_enkf !< Rank to be considered for inversion of HPH in analysis of EnKF !< (0) for analysis w/o eigendecomposition diff --git a/templates/online_omi_flexible/parser_mpi.F90 b/templates/online_omi_flexible/parser_mpi.F90 index 4269eed43..0b814ab44 100644 --- a/templates/online_omi_flexible/parser_mpi.F90 +++ b/templates/online_omi_flexible/parser_mpi.F90 @@ -53,6 +53,8 @@ MODULE parser use mpi + USE mod_parallel_pdaf, & + ONLY: abort_parallel IMPLICIT NONE SAVE @@ -187,6 +189,8 @@ SUBROUTINE parse_string(handle, charvalue) ! *** local variables *** CHARACTER(len=100) :: string CHARACTER(len=100) :: parsed_string + CHARACTER(len=110) :: str1_check + CHARACTER(len=110) :: str2_check LOGICAL :: modified ! *** Initialize *** @@ -206,9 +210,27 @@ SUBROUTINE parse_string(handle, charvalue) DO i = 1, command_argument_count() - 1 CALL get_command_argument(i, str1) CALL get_command_argument(i+1, str2) + + ! Add check for inadmissible strings longer than 100 + ! characters + CALL get_command_argument(i, str1_check) + CALL get_command_argument(i+1, str2_check) + IF (mype == 0) THEN + IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN + WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long." + WRITE (*,'(2x, a, 1x, a)') "called handle=", TRIM(string) + WRITE (*,'(2x, a, 1x, a)') "parsed handle=", TRIM(str1) + WRITE (*,'(2x, a, 1x, a)') "parsed input(cut)=", TRIM(str2) + call abort_parallel() + END IF + END IF + + #endif IF (str1 == TRIM(string)) THEN - READ(str2, *) parsed_string + ! Format specifier is needed for reading paths. Using + ! `*` as format specifier, reading stops at a `/` + READ(str2, '(a)') parsed_string modified = .TRUE. END IF ENDDO diff --git a/testsuite/src/Makefile b/testsuite/src/Makefile index c93eca509..17fd4b76c 100644 --- a/testsuite/src/Makefile +++ b/testsuite/src/Makefile @@ -180,7 +180,7 @@ cleandummy1Dsi: libpdaf-d.a: @echo "++++++ Generate Filter library ++++++" - @cd ../../src; make; + @cd ../..; make; .F90.o : $(FC) $(OPT) $(MPI_INC) $(CPP_DEFS) $(CPP_PDAF2) -Ioffline_1D -c $*.F90 @@ -208,7 +208,7 @@ cleanmodels: cleandummymodel cleanoffline cleandummy1Dsi cleandummysngl cleanpdaf: @echo "+++ Clean up PDAF directory" - cd ../../src; make clean + cd ../..; make clean distclean: cleanpdaf cleanall diff --git a/testsuite/src/main/parser_mpi.F90 b/testsuite/src/main/parser_mpi.F90 index 886442cd9..c3e9d1693 100644 --- a/testsuite/src/main/parser_mpi.F90 +++ b/testsuite/src/main/parser_mpi.F90 @@ -57,7 +57,8 @@ MODULE parser ! ! !USES: USE mpi - + USE mod_parallel, & + ONLY: abort_parallel IMPLICIT NONE SAVE @@ -191,6 +192,8 @@ SUBROUTINE parse_string(handle, charvalue) ! *** local variables *** CHARACTER(len=100) :: string CHARACTER(len=100) :: parsed_string + CHARACTER(len=110) :: str1_check + CHARACTER(len=110) :: str2_check LOGICAL :: modified ! *** Initialize *** @@ -210,9 +213,27 @@ SUBROUTINE parse_string(handle, charvalue) DO i = 1, command_argument_count() - 1 CALL get_command_argument(i, str1) CALL get_command_argument(i+1, str2) + + ! Add check for inadmissible strings longer than 100 + ! characters + CALL get_command_argument(i, str1_check) + CALL get_command_argument(i+1, str2_check) + IF (mype == 0) THEN + IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN + WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long." + WRITE (*,'(2x, a, 1x, a)') "called handle=", TRIM(string) + WRITE (*,'(2x, a, 1x, a)') "parsed handle=", TRIM(str1) + WRITE (*,'(2x, a, 1x, a)') "parsed input(cut)=", TRIM(str2) + call abort_parallel() + END IF + END IF + + #endif IF (str1 == TRIM(string)) THEN - READ(str2, *) parsed_string + ! Format specifier is needed for reading paths. Using + ! `*` as format specifier, reading stops at a `/` + READ(str2, '(a)') parsed_string modified = .TRUE. END IF ENDDO diff --git a/tutorial/3dvar/offline_2D_serial/Makefile b/tutorial/3dvar/offline_2D_serial/Makefile index 747347142..48a5abf33 100644 --- a/tutorial/3dvar/offline_2D_serial/Makefile +++ b/tutorial/3dvar/offline_2D_serial/Makefile @@ -66,9 +66,7 @@ OBJ_USER_GEN = init_ens_offline.o \ # User-supplied routines for localized analysis OBJ_USER_LOCAL = init_n_domains_pdaf.o \ - init_dim_l_pdaf.o \ - g2l_state_pdaf.o \ - l2g_state_pdaf.o + init_dim_l_pdaf.o # User-supplied routines for 3D-Var methods OBJ_USER_3DVAR = init_3dvar_offline.o \ @@ -95,7 +93,7 @@ $(EXE) : libpdaf-var.a \ libpdaf-var.a: @echo "++++++ Generate Filter library ++++++" - @cd $(BASEDIR)/src; make pdaf-var; + @cd $(BASEDIR); make; ###################################################### @@ -119,7 +117,7 @@ clean : cleanpdaf: @echo "+++ Clean up PDAF directory" - cd $(BASEDIR)/src; make clean + cd $(BASEDIR); make clean cleandata: rm -f ens*ana.txt state_ana.txt diff --git a/tutorial/3dvar/offline_2D_serial/assimilate_pdaf_offline.F90 b/tutorial/3dvar/offline_2D_serial/assimilate_pdaf_offline.F90 index b23e19ada..ae137b988 100644 --- a/tutorial/3dvar/offline_2D_serial/assimilate_pdaf_offline.F90 +++ b/tutorial/3dvar/offline_2D_serial/assimilate_pdaf_offline.F90 @@ -14,10 +14,11 @@ !! SUBROUTINE assimilate_pdaf_offline() - USE pdaf_interfaces_module, & ! Interface definitions to PDAF core routines - ONLY: PDAFomi_put_state_3dvar, PDAFomi_put_state_en3dvar_lestkf, & - PDAFomi_put_state_en3dvar_estkf, PDAFomi_put_state_hyb3dvar_lestkf, & + USE PDAF_interfaces_module, & ! Interface definitions to PDAF core routines + ONLY: PDAFomi_put_state_3dvar, PDAFomi_put_state_en3dvar_estkf, & PDAFomi_put_state_hyb3dvar_estkf + USE PDAFlocal, & ! Interface definitions for PDAFlocal + ONLY: PDAFlocalomi_put_state_en3dvar_lestkf, PDAFlocalomi_put_state_hyb3dvar_lestkf USE mod_parallel_pdaf, & ! Parallelization ONLY: mype_world, abort_parallel USE mod_assimilation, & ! Variables for assimilation @@ -43,9 +44,7 @@ SUBROUTINE assimilate_pdaf_offline() prepoststep_ens_offline ! User supplied pre/poststep routine ! Localization of state vector EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains - init_dim_l_pdaf, & ! Initialize state dimension for local analysis domain - g2l_state_pdaf, & ! Get state on local analysis domain from global state - l2g_state_pdaf ! Update global state from state on local analysis domain + init_dim_l_pdaf ! Initialize state dimension for local analysis domain ! Interface to PDAF-OMI for local and global filters EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain @@ -80,11 +79,11 @@ SUBROUTINE assimilate_pdaf_offline() prepoststep_3dvar_offline, status_pdaf) ELSEIF (subtype==1) THEN ! Ensemble 3D-Var with local ESTKF update of ensemble perturbations - CALL PDAFomi_put_state_en3dvar_lestkf(collect_state_pdaf, & + CALL PDAFlocalomi_put_state_en3dvar_lestkf(collect_state_pdaf, & init_dim_obs_pdafomi, obs_op_pdafomi, & cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdafomi, obs_op_adj_pdafomi, & init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdafomi, & - g2l_state_pdaf, l2g_state_pdaf, prepoststep_ens_offline, status_pdaf) + prepoststep_ens_offline, status_pdaf) ELSEIF (subtype==4) THEN ! Ensemble 3D-Var with global ESTKF update of ensemble perturbations CALL PDAFomi_put_state_en3dvar_estkf(collect_state_pdaf, & @@ -93,11 +92,11 @@ SUBROUTINE assimilate_pdaf_offline() prepoststep_ens_offline, status_pdaf) ELSEIF (subtype==6) THEN ! Hybrid 3D-Var with local ESTKF update of ensemble perturbations - CALL PDAFomi_put_state_hyb3dvar_lestkf(collect_state_pdaf, & + CALL PDAFlocalomi_put_state_hyb3dvar_lestkf(collect_state_pdaf, & init_dim_obs_pdafomi, obs_op_pdafomi, cvt_ens_pdaf, cvt_adj_ens_pdaf, & cvt_pdaf, cvt_adj_pdaf, obs_op_lin_pdafomi, obs_op_adj_pdafomi, & init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdafomi, & - g2l_state_pdaf, l2g_state_pdaf, prepoststep_ens_offline, status_pdaf) + prepoststep_ens_offline, status_pdaf) ELSEIF (subtype==7) THEN ! Hybrid 3D-Var with global ESTKF update of ensemble perturbations CALL PDAFomi_put_state_hyb3dvar_estkf(collect_state_pdaf, & diff --git a/tutorial/3dvar/offline_2D_serial/g2l_state_pdaf.F90 b/tutorial/3dvar/offline_2D_serial/g2l_state_pdaf.F90 deleted file mode 100644 index 177740d1a..000000000 --- a/tutorial/3dvar/offline_2D_serial/g2l_state_pdaf.F90 +++ /dev/null @@ -1,49 +0,0 @@ -!> Restrict a model state to a local analysis domain -!! -!! User-supplied call-back routine for PDAF. -!! -!! Used in the filters: LSEIK/LETKF/LESTKF/LNETF -!! -!! The routine is called during the loop over all -!! local analysis domains in PDAF_X_update -!! before the analysis on a single local analysis -!! domain. It has to initialize elements of the -!! state vector for the local analysis domains from -!! the PE-local full state vector. -!! -!! Generic implementation using index vector -!! ID_LSTATE_IN_PSTATE. -!! -!! __Revision history:__ -!! * 2013-02 - Lars Nerger - Initial code -!! * Later revisions - see repository log -!! -SUBROUTINE g2l_state_pdaf(step, domain_p, dim_p, state_p, dim_l, state_l) - - USE mod_assimilation, & - ONLY: id_lstate_in_pstate - - IMPLICIT NONE - -! *** Arguments *** - INTEGER, INTENT(in) :: step !< Current time step - INTEGER, INTENT(in) :: domain_p !< Current local analysis domain - INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension - INTEGER, INTENT(in) :: dim_l !< Local state dimension - REAL, INTENT(in) :: state_p(dim_p) !< PE-local full state vector - REAL, INTENT(out) :: state_l(dim_l) !< State vector on local analysis domain - -! *** local variables *** - INTEGER :: i ! Counter - - -! ************************************* -! *** Initialize local state vector *** -! ************************************* - - ! Generic initialization using ID_LSTATE_IN_PSTATE set in INIT_DIM_L_PDAF - DO i = 1, dim_l - state_l(i) = state_p(id_lstate_in_pstate(i)) - END DO - -END SUBROUTINE g2l_state_pdaf diff --git a/tutorial/3dvar/offline_2D_serial/init_dim_l_pdaf.F90 b/tutorial/3dvar/offline_2D_serial/init_dim_l_pdaf.F90 index 7ce79b7b8..f682e0cf4 100644 --- a/tutorial/3dvar/offline_2D_serial/init_dim_l_pdaf.F90 +++ b/tutorial/3dvar/offline_2D_serial/init_dim_l_pdaf.F90 @@ -16,8 +16,10 @@ !! SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) + USE PDAFlocal, & ! Routine to provide local indices to PDAF + ONLY: PDAFlocal_set_indices USE mod_assimilation, & ! Variables for assimilation - ONLY: coords_l, id_lstate_in_pstate, ny + ONLY: coords_l, ny IMPLICIT NONE @@ -26,6 +28,9 @@ SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) INTEGER, INTENT(in) :: domain_p !< Current local analysis domain INTEGER, INTENT(out) :: dim_l !< Local state dimension +! *** local variables *** + INTEGER, ALLOCATABLE :: id_lstate_in_pstate(:) !< Indices of local state vector in PE-local global state vector + ! **************************************** ! *** Initialize local state dimension *** @@ -49,10 +54,15 @@ SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) ! ****************************************************** ! Allocate array - IF (ALLOCATED(id_lstate_in_pstate)) DEALLOCATE(id_lstate_in_pstate) ALLOCATE(id_lstate_in_pstate(dim_l)) ! Here the local domain is a single grid point and variable given by DOMAIN_P id_lstate_in_pstate(1) = domain_p + ! Provide the index vector to PDAF + CALL PDAFlocal_set_indices(dim_l, id_lstate_in_pstate) + + ! Deallocate index array + DEALLOCATE(id_lstate_in_pstate) + END SUBROUTINE init_dim_l_pdaf diff --git a/tutorial/3dvar/offline_2D_serial/l2g_state_pdaf.F90 b/tutorial/3dvar/offline_2D_serial/l2g_state_pdaf.F90 deleted file mode 100644 index 1a27e44f2..000000000 --- a/tutorial/3dvar/offline_2D_serial/l2g_state_pdaf.F90 +++ /dev/null @@ -1,50 +0,0 @@ -!> Initialize full state from local analysis -!! -!! User-supplied call-back routine for PDAF. -!! -!! Used in the filters: LSEIK/LETKF/LESTKF/LNETF -!! -!! The routine is called during the loop over all -!! local analysis domains in PDAF_X_update -!! after the analysis and ensemble transformation -!! on a single local analysis domain. It has to -!! initialize elements of the PE-local full state -!! vector from the provided analysis state vector -!! on the local analysis domain. -!! -!! Generic implementation using index vector -!! ID_LSTATE_IN_PSTATE. -!! -!! __Revision history:__ -!! * 2013-02 - Lars Nerger - Initial code -!! * Later revisions - see repository log -!! -SUBROUTINE l2g_state_pdaf(step, domain_p, dim_l, state_l, dim_p, state_p) - - USE mod_assimilation, & - ONLY: id_lstate_in_pstate - - IMPLICIT NONE - -! *** Arguments *** - INTEGER, INTENT(in) :: step !< Current time step - INTEGER, INTENT(in) :: domain_p !< Current local analysis domain - INTEGER, INTENT(in) :: dim_l !< Local state dimension - INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension - REAL, INTENT(in) :: state_l(dim_l) !< State vector on local analysis domain - REAL, INTENT(inout) :: state_p(dim_p) !< PE-local full state vector - -! *** local variables *** - INTEGER :: i ! Counter - - -! ************************************************** -! *** Initialize elements of global state vector *** -! ************************************************** - - ! Generic initialization using ID_LSTATE_IN_PSTATE set in INIT_DIM_L_PDAF - DO i = 1, dim_l - state_p(id_lstate_in_pstate(i)) = state_l(i) - END DO - -END SUBROUTINE l2g_state_pdaf diff --git a/tutorial/3dvar/offline_2D_serial/mod_assimilation.F90 b/tutorial/3dvar/offline_2D_serial/mod_assimilation.F90 index fa3d69e84..67caf9844 100644 --- a/tutorial/3dvar/offline_2D_serial/mod_assimilation.F90 +++ b/tutorial/3dvar/offline_2D_serial/mod_assimilation.F90 @@ -29,9 +29,9 @@ MODULE mod_assimilation ! *** Variables specific for model setup *** REAL :: coords_l(2) !< Coordinates of local analysis domain - INTEGER, ALLOCATABLE :: id_lstate_in_pstate(:) !< Indices of local state vector in PE-local global state vector - ! Variables to handle multiple fields in the state vector +! *** Variables to handle multiple fields in the state vector *** + INTEGER :: n_fields !< number of fields in state vector INTEGER, ALLOCATABLE :: off_fields(:) !< Offsets of fields in state vector INTEGER, ALLOCATABLE :: dim_fields(:) !< Dimension of fields in state vector @@ -46,7 +46,7 @@ MODULE mod_assimilation ! Type variable holding field IDs in state vector TYPE(field_ids) :: id -!$OMP THREADPRIVATE(coords_l, id_lstate_in_pstate) +!$OMP THREADPRIVATE(coords_l) ! ----------------------------------------------------------------- @@ -71,18 +71,12 @@ MODULE mod_assimilation !< * (1) progress info !< * (2) add timings !< * (3) debugging output - INTEGER :: dim_ens !< Size of ensemble for SEIK/LSEIK/EnKF/ETKF \n - !< Number of EOFs to be used for SEEK + INTEGER :: dim_ens !< Size of ensemble INTEGER :: filtertype !< Select filter algorithm: - !< * SEEK (0), SEIK (1), EnKF (2), LSEIK (3), ETKF (4) + !< * SEIK (1), EnKF (2), LSEIK (3), ETKF (4) !< LETKF (5), ESTKF (6), LESTKF (7), NETF (9), LNETF (10) !< LKNETF (11), PF (12), GENOBS (100), 3DVAR (200) INTEGER :: subtype !< Subtype of filter algorithm - !< * SEEK: - !< (0) evolve normalized modes - !< (1) evolve scaled modes with unit U - !< (2) fixed basis (V); variable U matrix - !< (3) fixed covar matrix (V,U kept static) !< * SEIK: !< (0) ensemble forecast; new formulation !< (1) ensemble forecast; old formulation @@ -156,9 +150,6 @@ MODULE mod_assimilation !< (4) regulated localization of R with single-point error variance REAL :: sradius !< Support radius for 5th order polynomial !< or radius for 1/e for exponential weighting -! ! SEEK - INTEGER :: int_rediag !< Interval to perform re-diagonalization in SEEK - REAL :: epsilon !< Epsilon for gradient approx. in SEEK forecast ! ! ENKF INTEGER :: rank_ana_enkf !< Rank to be considered for inversion of HPH in analysis of EnKF !< (0) for analysis w/o eigendecomposition diff --git a/tutorial/3dvar/offline_2D_serial/parser_mpi.F90 b/tutorial/3dvar/offline_2D_serial/parser_mpi.F90 index 4269eed43..40258b6ac 100644 --- a/tutorial/3dvar/offline_2D_serial/parser_mpi.F90 +++ b/tutorial/3dvar/offline_2D_serial/parser_mpi.F90 @@ -47,12 +47,14 @@ !! to be specified as 'T' or 'F'. !! !! __Revision history:__ -!! * 2019-06 - Stephan Frickenhaus, Lars Nerger - Initial code +!! * 2003-02 - Stephan Frickenhaus, Lars Nerger - Initial code !! * Later revisions - see repository log !! MODULE parser use mpi + USE mod_parallel_pdaf, & + ONLY: abort_parallel IMPLICIT NONE SAVE @@ -187,6 +189,8 @@ SUBROUTINE parse_string(handle, charvalue) ! *** local variables *** CHARACTER(len=100) :: string CHARACTER(len=100) :: parsed_string + CHARACTER(len=110) :: str1_check + CHARACTER(len=110) :: str2_check LOGICAL :: modified ! *** Initialize *** @@ -206,9 +210,27 @@ SUBROUTINE parse_string(handle, charvalue) DO i = 1, command_argument_count() - 1 CALL get_command_argument(i, str1) CALL get_command_argument(i+1, str2) + + ! Add check for inadmissible strings longer than 100 + ! characters + CALL get_command_argument(i, str1_check) + CALL get_command_argument(i+1, str2_check) + IF (mype == 0) THEN + IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN + WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long." + WRITE (*,'(2x, a, 1x, a)') "called handle=", TRIM(string) + WRITE (*,'(2x, a, 1x, a)') "parsed handle=", TRIM(str1) + WRITE (*,'(2x, a, 1x, a)') "parsed input(cut)=", TRIM(str2) + call abort_parallel() + END IF + END IF + + #endif IF (str1 == TRIM(string)) THEN - READ(str2, *) parsed_string + ! Format specifier is needed for reading paths. Using + ! `*` as format specifier, reading stops at a `/` + READ(str2, '(a)') parsed_string modified = .TRUE. END IF ENDDO diff --git a/tutorial/3dvar/online_2D_parallelmodel/Makefile b/tutorial/3dvar/online_2D_parallelmodel/Makefile index 944fff9af..d593d26f1 100644 --- a/tutorial/3dvar/online_2D_parallelmodel/Makefile +++ b/tutorial/3dvar/online_2D_parallelmodel/Makefile @@ -69,9 +69,7 @@ OBJ_USER_GEN = init_ens_pdaf.o \ # User-supplied routines for localized analysis (LESTKF/LSEIK/LETKF) OBJ_USER_LOCAL = init_n_domains_pdaf.o \ - init_dim_l_pdaf.o \ - g2l_state_pdaf.o \ - l2g_state_pdaf.o + init_dim_l_pdaf.o # User-supplied routines for 3D-Var methods OBJ_USER_3DVAR = init_3dvar_pdaf.o \ @@ -117,7 +115,7 @@ model_pdaf : libpdaf-var.a \ libpdaf-var.a: @echo "++++++ Generate Filter library ++++++" - @cd $(BASEDIR)/src; make pdaf-var; + @cd $(BASEDIR); make; ###################################################### @@ -142,7 +140,7 @@ clean : cleanpdaf: @echo "+++ Clean up PDAF directory" - cd $(BASEDIR)/src; make clean + cd $(BASEDIR); make clean cleandata: rm -f ens*ana.txt ens*for.txt state_*ana.txt state_*for.txt diff --git a/tutorial/3dvar/online_2D_parallelmodel/assimilate_pdaf.F90 b/tutorial/3dvar/online_2D_parallelmodel/assimilate_pdaf.F90 index 7a19af55d..89492c51f 100644 --- a/tutorial/3dvar/online_2D_parallelmodel/assimilate_pdaf.F90 +++ b/tutorial/3dvar/online_2D_parallelmodel/assimilate_pdaf.F90 @@ -12,9 +12,10 @@ SUBROUTINE assimilate_pdaf() USE pdaf_interfaces_module, & ! Interface definitions to PDAF core routines - ONLY: PDAFomi_assimilate_3dvar, & - PDAFomi_assimilate_en3dvar_lestkf, PDAFomi_assimilate_en3dvar_estkf, & - PDAFomi_assimilate_hyb3dvar_lestkf, PDAFomi_assimilate_hyb3dvar_estkf + ONLY: PDAFomi_assimilate_3dvar, PDAFomi_assimilate_en3dvar_estkf, & + PDAFomi_assimilate_hyb3dvar_estkf + USE PDAFlocal, & ! Interface definitions for PDAFlocal + ONLY: PDAFlocalomi_assimilate_en3dvar_lestkf, PDAFlocalomi_assimilate_hyb3dvar_lestkf USE mod_parallel_model, & ! Parallelization variables ONLY: mype_world, abort_parallel USE mod_assimilation, & ! Variables for assimilation @@ -40,9 +41,7 @@ SUBROUTINE assimilate_pdaf() prepoststep_ens_pdaf ! User supplied pre/poststep routine ! Localization of state vector EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains - init_dim_l_pdaf, & ! Initialize state dimension for local analysis domain - g2l_state_pdaf, & ! Get state on local analysis domain from global state - l2g_state_pdaf ! Update global state from state on local analysis domain + init_dim_l_pdaf ! Initialize state dimension for local analysis domain ! Interface to PDAF-OMI for local and global filters EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain @@ -69,11 +68,10 @@ SUBROUTINE assimilate_pdaf() prepoststep_3dvar_pdaf, next_observation_pdaf, status_pdaf) ELSEIF (subtype==1) THEN ! Ensemble 3D-Var with local ESTKF update of ensemble perturbations - CALL PDAFomi_assimilate_en3dvar_lestkf(collect_state_pdaf, distribute_state_pdaf, & + CALL PDAFlocalomi_assimilate_en3dvar_lestkf(collect_state_pdaf, distribute_state_pdaf, & init_dim_obs_pdafomi, obs_op_pdafomi, & cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdafomi, obs_op_adj_pdafomi, & init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdafomi, & - g2l_state_pdaf, l2g_state_pdaf, & prepoststep_ens_pdaf, next_observation_pdaf, status_pdaf) ELSEIF (subtype==4) THEN ! Ensemble 3D-Var with global ESTKF update of ensemble perturbations @@ -83,12 +81,11 @@ SUBROUTINE assimilate_pdaf() prepoststep_ens_pdaf, next_observation_pdaf, status_pdaf) ELSEIF (subtype==6) THEN ! Hybrid 3D-Var with local ESTKF update of ensemble perturbations - CALL PDAFomi_assimilate_hyb3dvar_lestkf(collect_state_pdaf, distribute_state_pdaf, & + CALL PDAFlocalomi_assimilate_hyb3dvar_lestkf(collect_state_pdaf, distribute_state_pdaf, & init_dim_obs_pdafomi, obs_op_pdafomi, & cvt_ens_pdaf, cvt_adj_ens_pdaf, cvt_pdaf, cvt_adj_pdaf, & obs_op_lin_pdafomi, obs_op_adj_pdafomi, & init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdafomi, & - g2l_state_pdaf, l2g_state_pdaf, & prepoststep_ens_pdaf, next_observation_pdaf, status_pdaf) ELSEIF (subtype==7) THEN ! Hybrid 3D-Var with global ESTKF update of ensemble perturbations diff --git a/tutorial/3dvar/online_2D_parallelmodel/g2l_state_pdaf.F90 b/tutorial/3dvar/online_2D_parallelmodel/g2l_state_pdaf.F90 deleted file mode 100644 index 177740d1a..000000000 --- a/tutorial/3dvar/online_2D_parallelmodel/g2l_state_pdaf.F90 +++ /dev/null @@ -1,49 +0,0 @@ -!> Restrict a model state to a local analysis domain -!! -!! User-supplied call-back routine for PDAF. -!! -!! Used in the filters: LSEIK/LETKF/LESTKF/LNETF -!! -!! The routine is called during the loop over all -!! local analysis domains in PDAF_X_update -!! before the analysis on a single local analysis -!! domain. It has to initialize elements of the -!! state vector for the local analysis domains from -!! the PE-local full state vector. -!! -!! Generic implementation using index vector -!! ID_LSTATE_IN_PSTATE. -!! -!! __Revision history:__ -!! * 2013-02 - Lars Nerger - Initial code -!! * Later revisions - see repository log -!! -SUBROUTINE g2l_state_pdaf(step, domain_p, dim_p, state_p, dim_l, state_l) - - USE mod_assimilation, & - ONLY: id_lstate_in_pstate - - IMPLICIT NONE - -! *** Arguments *** - INTEGER, INTENT(in) :: step !< Current time step - INTEGER, INTENT(in) :: domain_p !< Current local analysis domain - INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension - INTEGER, INTENT(in) :: dim_l !< Local state dimension - REAL, INTENT(in) :: state_p(dim_p) !< PE-local full state vector - REAL, INTENT(out) :: state_l(dim_l) !< State vector on local analysis domain - -! *** local variables *** - INTEGER :: i ! Counter - - -! ************************************* -! *** Initialize local state vector *** -! ************************************* - - ! Generic initialization using ID_LSTATE_IN_PSTATE set in INIT_DIM_L_PDAF - DO i = 1, dim_l - state_l(i) = state_p(id_lstate_in_pstate(i)) - END DO - -END SUBROUTINE g2l_state_pdaf diff --git a/tutorial/3dvar/online_2D_parallelmodel/init_dim_l_pdaf.F90 b/tutorial/3dvar/online_2D_parallelmodel/init_dim_l_pdaf.F90 index c9425efb5..70aea27f7 100644 --- a/tutorial/3dvar/online_2D_parallelmodel/init_dim_l_pdaf.F90 +++ b/tutorial/3dvar/online_2D_parallelmodel/init_dim_l_pdaf.F90 @@ -16,10 +16,12 @@ !! SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) + USE PDAFlocal, & ! Routine to provide local indices to PDAF + ONLY: PDAFlocal_set_indices USE mod_model, & ! Model variables ONLY: ny, nx_p USE mod_assimilation, & ! Variables for assimilation - ONLY: coords_l, id_lstate_in_pstate + ONLY: coords_l USE mod_parallel_pdaf, & ! assimilation parallelization variables ONLY: mype_filter @@ -33,6 +35,7 @@ SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) ! *** local variables *** INTEGER :: i ! Counters INTEGER :: off_p ! Process-local offset in global state vector + INTEGER, ALLOCATABLE :: id_lstate_in_pstate(:) !< Indices of local state vector in PE-local global state vector ! **************************************** @@ -62,10 +65,15 @@ SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) ! ****************************************************** ! Allocate array - IF (ALLOCATED(id_lstate_in_pstate)) DEALLOCATE(id_lstate_in_pstate) ALLOCATE(id_lstate_in_pstate(dim_l)) ! Here the local domain is a single grid point and variable given by DOMAIN_P id_lstate_in_pstate(1) = domain_p + ! Provide the index vector to PDAF + CALL PDAFlocal_set_indices(dim_l, id_lstate_in_pstate) + + ! Deallocate index array + DEALLOCATE(id_lstate_in_pstate) + END SUBROUTINE init_dim_l_pdaf diff --git a/tutorial/3dvar/online_2D_parallelmodel/l2g_state_pdaf.F90 b/tutorial/3dvar/online_2D_parallelmodel/l2g_state_pdaf.F90 deleted file mode 100644 index 1a27e44f2..000000000 --- a/tutorial/3dvar/online_2D_parallelmodel/l2g_state_pdaf.F90 +++ /dev/null @@ -1,50 +0,0 @@ -!> Initialize full state from local analysis -!! -!! User-supplied call-back routine for PDAF. -!! -!! Used in the filters: LSEIK/LETKF/LESTKF/LNETF -!! -!! The routine is called during the loop over all -!! local analysis domains in PDAF_X_update -!! after the analysis and ensemble transformation -!! on a single local analysis domain. It has to -!! initialize elements of the PE-local full state -!! vector from the provided analysis state vector -!! on the local analysis domain. -!! -!! Generic implementation using index vector -!! ID_LSTATE_IN_PSTATE. -!! -!! __Revision history:__ -!! * 2013-02 - Lars Nerger - Initial code -!! * Later revisions - see repository log -!! -SUBROUTINE l2g_state_pdaf(step, domain_p, dim_l, state_l, dim_p, state_p) - - USE mod_assimilation, & - ONLY: id_lstate_in_pstate - - IMPLICIT NONE - -! *** Arguments *** - INTEGER, INTENT(in) :: step !< Current time step - INTEGER, INTENT(in) :: domain_p !< Current local analysis domain - INTEGER, INTENT(in) :: dim_l !< Local state dimension - INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension - REAL, INTENT(in) :: state_l(dim_l) !< State vector on local analysis domain - REAL, INTENT(inout) :: state_p(dim_p) !< PE-local full state vector - -! *** local variables *** - INTEGER :: i ! Counter - - -! ************************************************** -! *** Initialize elements of global state vector *** -! ************************************************** - - ! Generic initialization using ID_LSTATE_IN_PSTATE set in INIT_DIM_L_PDAF - DO i = 1, dim_l - state_p(id_lstate_in_pstate(i)) = state_l(i) - END DO - -END SUBROUTINE l2g_state_pdaf diff --git a/tutorial/3dvar/online_2D_parallelmodel/mod_assimilation.F90 b/tutorial/3dvar/online_2D_parallelmodel/mod_assimilation.F90 index fde1bde58..20eb899c1 100644 --- a/tutorial/3dvar/online_2D_parallelmodel/mod_assimilation.F90 +++ b/tutorial/3dvar/online_2D_parallelmodel/mod_assimilation.F90 @@ -35,9 +35,9 @@ MODULE mod_assimilation ! *** Variables specific for model setup *** REAL :: coords_l(2) !< Coordinates of local analysis domain - INTEGER, ALLOCATABLE :: id_lstate_in_pstate(:) !< Indices of local state vector in PE-local global state vector - ! Variables to handle multiple fields in the state vector +! *** Variables to handle multiple fields in the state vector *** + INTEGER :: n_fields !< number of fields in state vector INTEGER, ALLOCATABLE :: off_fields(:) !< Offsets of fields in state vector INTEGER, ALLOCATABLE :: dim_fields(:) !< Dimension of fields in state vector @@ -52,7 +52,7 @@ MODULE mod_assimilation ! Type variable holding field IDs in state vector TYPE(field_ids) :: id -!$OMP THREADPRIVATE(coords_l, id_lstate_in_pstate) +!$OMP THREADPRIVATE(coords_l) ! ----------------------------------------------------------------- @@ -77,18 +77,12 @@ MODULE mod_assimilation !< * (1) progress info !< * (2) add timings !< * (3) debugging output - INTEGER :: dim_ens !< Size of ensemble for SEIK/LSEIK/EnKF/ETKF \n - !< Number of EOFs to be used for SEEK + INTEGER :: dim_ens !< Size of ensemble INTEGER :: filtertype !< Select filter algorithm: - !< * SEEK (0), SEIK (1), EnKF (2), LSEIK (3), ETKF (4) + !< * SEIK (1), EnKF (2), LSEIK (3), ETKF (4) !< LETKF (5), ESTKF (6), LESTKF (7), NETF (9), LNETF (10) !< LKNETF (11), PF (12), GENOBS (100), 3DVAR (200) INTEGER :: subtype !< Subtype of filter algorithm - !< * SEEK: - !< (0) evolve normalized modes - !< (1) evolve scaled modes with unit U - !< (2) fixed basis (V); variable U matrix - !< (3) fixed covar matrix (V,U kept static) !< * SEIK: !< (0) ensemble forecast; new formulation !< (1) ensemble forecast; old formulation @@ -162,9 +156,6 @@ MODULE mod_assimilation !< (4) regulated localization of R with single-point error variance REAL :: sradius !< Support radius for 5th order polynomial !< or radius for 1/e for exponential weighting -! ! SEEK - INTEGER :: int_rediag !< Interval to perform re-diagonalization in SEEK - REAL :: epsilon !< Epsilon for gradient approx. in SEEK forecast ! ! ENKF INTEGER :: rank_ana_enkf !< Rank to be considered for inversion of HPH in analysis of EnKF !< (0) for analysis w/o eigendecomposition diff --git a/tutorial/3dvar/online_2D_parallelmodel/parser_mpi.F90 b/tutorial/3dvar/online_2D_parallelmodel/parser_mpi.F90 index 4269eed43..6ddcbb65d 100644 --- a/tutorial/3dvar/online_2D_parallelmodel/parser_mpi.F90 +++ b/tutorial/3dvar/online_2D_parallelmodel/parser_mpi.F90 @@ -47,12 +47,14 @@ !! to be specified as 'T' or 'F'. !! !! __Revision history:__ -!! * 2019-06 - Stephan Frickenhaus, Lars Nerger - Initial code +!! * 2003-02 - Stephan Frickenhaus, Lars Nerger - Initial code !! * Later revisions - see repository log !! MODULE parser use mpi + USE mod_parallel_model, & + ONLY: abort_parallel IMPLICIT NONE SAVE @@ -187,6 +189,8 @@ SUBROUTINE parse_string(handle, charvalue) ! *** local variables *** CHARACTER(len=100) :: string CHARACTER(len=100) :: parsed_string + CHARACTER(len=110) :: str1_check + CHARACTER(len=110) :: str2_check LOGICAL :: modified ! *** Initialize *** @@ -206,9 +210,27 @@ SUBROUTINE parse_string(handle, charvalue) DO i = 1, command_argument_count() - 1 CALL get_command_argument(i, str1) CALL get_command_argument(i+1, str2) + + ! Add check for inadmissible strings longer than 100 + ! characters + CALL get_command_argument(i, str1_check) + CALL get_command_argument(i+1, str2_check) + IF (mype == 0) THEN + IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN + WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long." + WRITE (*,'(2x, a, 1x, a)') "called handle=", TRIM(string) + WRITE (*,'(2x, a, 1x, a)') "parsed handle=", TRIM(str1) + WRITE (*,'(2x, a, 1x, a)') "parsed input(cut)=", TRIM(str2) + call abort_parallel() + END IF + END IF + + #endif IF (str1 == TRIM(string)) THEN - READ(str2, *) parsed_string + ! Format specifier is needed for reading paths. Using + ! `*` as format specifier, reading stops at a `/` + READ(str2, '(a)') parsed_string modified = .TRUE. END IF ENDDO diff --git a/tutorial/3dvar/online_2D_serialmodel/Makefile b/tutorial/3dvar/online_2D_serialmodel/Makefile index c9419899d..83e1d885d 100644 --- a/tutorial/3dvar/online_2D_serialmodel/Makefile +++ b/tutorial/3dvar/online_2D_serialmodel/Makefile @@ -69,9 +69,7 @@ OBJ_USER_GEN = init_ens_pdaf.o \ # User-supplied routines for state in localized analysis (LESTKF/LSEIK/LETKF) OBJ_USER_LOCAL = init_n_domains_pdaf.o \ - init_dim_l_pdaf.o \ - g2l_state_pdaf.o \ - l2g_state_pdaf.o + init_dim_l_pdaf.o # User-supplied routines for 3D-Var methods OBJ_USER_3DVAR = init_3dvar_pdaf.o \ @@ -115,7 +113,7 @@ model_pdaf : libpdaf-var.a \ libpdaf-var.a: @echo "++++++ Generate Filter library ++++++" - @cd $(BASEDIR)/src; make pdaf-var; + @cd $(BASEDIR); make; ###################################################### @@ -140,7 +138,7 @@ clean : cleanpdaf: @echo "+++ Clean up PDAF directory" - cd $(BASEDIR)/src; make clean + cd $(BASEDIR); make clean cleandata: rm -f ens*ana.txt ens*for.txt state_*ana.txt state_*for.txt diff --git a/tutorial/3dvar/online_2D_serialmodel/assimilate_pdaf.F90 b/tutorial/3dvar/online_2D_serialmodel/assimilate_pdaf.F90 index 4e4a38ca5..dc2dfe806 100644 --- a/tutorial/3dvar/online_2D_serialmodel/assimilate_pdaf.F90 +++ b/tutorial/3dvar/online_2D_serialmodel/assimilate_pdaf.F90 @@ -1,4 +1,4 @@ -!> Routine to call PDAF for analysis step +!> Routine to call PDAF for analysis step in fully-parallel mode !! !! This routine is called during the model integrations at each time !! step. It calls the filter-specific assimilation routine of PDAF @@ -12,9 +12,10 @@ SUBROUTINE assimilate_pdaf() USE pdaf_interfaces_module, & ! Interface definitions to PDAF core routines - ONLY: PDAFomi_assimilate_3dvar, & - PDAFomi_assimilate_en3dvar_lestkf, PDAFomi_assimilate_en3dvar_estkf, & - PDAFomi_assimilate_hyb3dvar_lestkf, PDAFomi_assimilate_hyb3dvar_estkf + ONLY: PDAFomi_assimilate_3dvar, PDAFomi_assimilate_en3dvar_estkf, & + PDAFomi_assimilate_hyb3dvar_estkf + USE PDAFlocal, & ! Interface definitions for PDAFlocal + ONLY: PDAFlocalomi_assimilate_en3dvar_lestkf, PDAFlocalomi_assimilate_hyb3dvar_lestkf USE mod_parallel_pdaf, & ! Parallelization variables ONLY: mype_world, abort_parallel USE mod_assimilation, & ! Variables for assimilation @@ -40,9 +41,7 @@ SUBROUTINE assimilate_pdaf() prepoststep_ens_pdaf ! User supplied pre/poststep routine ! Localization of state vector EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains - init_dim_l_pdaf, & ! Initialize state dimension for local analysis domain - g2l_state_pdaf, & ! Get state on local analysis domain from global state - l2g_state_pdaf ! Update global state from state on local analysis domain + init_dim_l_pdaf ! Initialize state dimension for local analysis domain ! Interface to PDAF-OMI for local and global filters EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain @@ -69,11 +68,10 @@ SUBROUTINE assimilate_pdaf() prepoststep_3dvar_pdaf, next_observation_pdaf, status_pdaf) ELSEIF (subtype==1) THEN ! Ensemble 3D-Var with local ESTKF update of ensemble perturbations - CALL PDAFomi_assimilate_en3dvar_lestkf(collect_state_pdaf, distribute_state_pdaf, & + CALL PDAFlocalomi_assimilate_en3dvar_lestkf(collect_state_pdaf, distribute_state_pdaf, & init_dim_obs_pdafomi, obs_op_pdafomi, & cvt_ens_pdaf, cvt_adj_ens_pdaf, obs_op_lin_pdafomi, obs_op_adj_pdafomi, & init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdafomi, & - g2l_state_pdaf, l2g_state_pdaf, & prepoststep_ens_pdaf, next_observation_pdaf, status_pdaf) ELSEIF (subtype==4) THEN ! Ensemble 3D-Var with global ESTKF update of ensemble perturbations @@ -83,12 +81,11 @@ SUBROUTINE assimilate_pdaf() prepoststep_ens_pdaf, next_observation_pdaf, status_pdaf) ELSEIF (subtype==6) THEN ! Hybrid 3D-Var with local ESTKF update of ensemble perturbations - CALL PDAFomi_assimilate_hyb3dvar_lestkf(collect_state_pdaf, distribute_state_pdaf, & + CALL PDAFlocalomi_assimilate_hyb3dvar_lestkf(collect_state_pdaf, distribute_state_pdaf, & init_dim_obs_pdafomi, obs_op_pdafomi, & cvt_ens_pdaf, cvt_adj_ens_pdaf, cvt_pdaf, cvt_adj_pdaf, & obs_op_lin_pdafomi, obs_op_adj_pdafomi, & init_n_domains_pdaf, init_dim_l_pdaf, init_dim_obs_l_pdafomi, & - g2l_state_pdaf, l2g_state_pdaf, & prepoststep_ens_pdaf, next_observation_pdaf, status_pdaf) ELSEIF (subtype==7) THEN ! Hybrid 3D-Var with global ESTKF update of ensemble perturbations diff --git a/tutorial/3dvar/online_2D_serialmodel/g2l_state_pdaf.F90 b/tutorial/3dvar/online_2D_serialmodel/g2l_state_pdaf.F90 deleted file mode 100644 index 177740d1a..000000000 --- a/tutorial/3dvar/online_2D_serialmodel/g2l_state_pdaf.F90 +++ /dev/null @@ -1,49 +0,0 @@ -!> Restrict a model state to a local analysis domain -!! -!! User-supplied call-back routine for PDAF. -!! -!! Used in the filters: LSEIK/LETKF/LESTKF/LNETF -!! -!! The routine is called during the loop over all -!! local analysis domains in PDAF_X_update -!! before the analysis on a single local analysis -!! domain. It has to initialize elements of the -!! state vector for the local analysis domains from -!! the PE-local full state vector. -!! -!! Generic implementation using index vector -!! ID_LSTATE_IN_PSTATE. -!! -!! __Revision history:__ -!! * 2013-02 - Lars Nerger - Initial code -!! * Later revisions - see repository log -!! -SUBROUTINE g2l_state_pdaf(step, domain_p, dim_p, state_p, dim_l, state_l) - - USE mod_assimilation, & - ONLY: id_lstate_in_pstate - - IMPLICIT NONE - -! *** Arguments *** - INTEGER, INTENT(in) :: step !< Current time step - INTEGER, INTENT(in) :: domain_p !< Current local analysis domain - INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension - INTEGER, INTENT(in) :: dim_l !< Local state dimension - REAL, INTENT(in) :: state_p(dim_p) !< PE-local full state vector - REAL, INTENT(out) :: state_l(dim_l) !< State vector on local analysis domain - -! *** local variables *** - INTEGER :: i ! Counter - - -! ************************************* -! *** Initialize local state vector *** -! ************************************* - - ! Generic initialization using ID_LSTATE_IN_PSTATE set in INIT_DIM_L_PDAF - DO i = 1, dim_l - state_l(i) = state_p(id_lstate_in_pstate(i)) - END DO - -END SUBROUTINE g2l_state_pdaf diff --git a/tutorial/3dvar/online_2D_serialmodel/init_dim_l_pdaf.F90 b/tutorial/3dvar/online_2D_serialmodel/init_dim_l_pdaf.F90 index 711074f13..3d751a495 100644 --- a/tutorial/3dvar/online_2D_serialmodel/init_dim_l_pdaf.F90 +++ b/tutorial/3dvar/online_2D_serialmodel/init_dim_l_pdaf.F90 @@ -16,10 +16,12 @@ !! SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) + USE PDAFlocal, & ! Routine to provide local indices to PDAF + ONLY: PDAFlocal_set_indices USE mod_model, & ! Model variables ONLY: ny USE mod_assimilation, & ! Variables for assimilation - ONLY: coords_l, id_lstate_in_pstate + ONLY: coords_l IMPLICIT NONE @@ -28,6 +30,9 @@ SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) INTEGER, INTENT(in) :: domain_p !< Current local analysis domain INTEGER, INTENT(out) :: dim_l !< Local state dimension +! *** local variables *** + INTEGER, ALLOCATABLE :: id_lstate_in_pstate(:) !< Indices of local state vector in PE-local global state vector + ! **************************************** ! *** Initialize local state dimension *** @@ -51,10 +56,15 @@ SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) ! ****************************************************** ! Allocate array - IF (ALLOCATED(id_lstate_in_pstate)) DEALLOCATE(id_lstate_in_pstate) ALLOCATE(id_lstate_in_pstate(dim_l)) ! Here the local domain is a single grid point and variable given by DOMAIN_P id_lstate_in_pstate(1) = domain_p + ! Provide the index vector to PDAF + CALL PDAFlocal_set_indices(dim_l, id_lstate_in_pstate) + + ! Deallocate index array + DEALLOCATE(id_lstate_in_pstate) + END SUBROUTINE init_dim_l_pdaf diff --git a/tutorial/3dvar/online_2D_serialmodel/l2g_state_pdaf.F90 b/tutorial/3dvar/online_2D_serialmodel/l2g_state_pdaf.F90 deleted file mode 100644 index 1a27e44f2..000000000 --- a/tutorial/3dvar/online_2D_serialmodel/l2g_state_pdaf.F90 +++ /dev/null @@ -1,50 +0,0 @@ -!> Initialize full state from local analysis -!! -!! User-supplied call-back routine for PDAF. -!! -!! Used in the filters: LSEIK/LETKF/LESTKF/LNETF -!! -!! The routine is called during the loop over all -!! local analysis domains in PDAF_X_update -!! after the analysis and ensemble transformation -!! on a single local analysis domain. It has to -!! initialize elements of the PE-local full state -!! vector from the provided analysis state vector -!! on the local analysis domain. -!! -!! Generic implementation using index vector -!! ID_LSTATE_IN_PSTATE. -!! -!! __Revision history:__ -!! * 2013-02 - Lars Nerger - Initial code -!! * Later revisions - see repository log -!! -SUBROUTINE l2g_state_pdaf(step, domain_p, dim_l, state_l, dim_p, state_p) - - USE mod_assimilation, & - ONLY: id_lstate_in_pstate - - IMPLICIT NONE - -! *** Arguments *** - INTEGER, INTENT(in) :: step !< Current time step - INTEGER, INTENT(in) :: domain_p !< Current local analysis domain - INTEGER, INTENT(in) :: dim_l !< Local state dimension - INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension - REAL, INTENT(in) :: state_l(dim_l) !< State vector on local analysis domain - REAL, INTENT(inout) :: state_p(dim_p) !< PE-local full state vector - -! *** local variables *** - INTEGER :: i ! Counter - - -! ************************************************** -! *** Initialize elements of global state vector *** -! ************************************************** - - ! Generic initialization using ID_LSTATE_IN_PSTATE set in INIT_DIM_L_PDAF - DO i = 1, dim_l - state_p(id_lstate_in_pstate(i)) = state_l(i) - END DO - -END SUBROUTINE l2g_state_pdaf diff --git a/tutorial/3dvar/online_2D_serialmodel/mod_assimilation.F90 b/tutorial/3dvar/online_2D_serialmodel/mod_assimilation.F90 index 1e07ef849..75a88fff0 100644 --- a/tutorial/3dvar/online_2D_serialmodel/mod_assimilation.F90 +++ b/tutorial/3dvar/online_2D_serialmodel/mod_assimilation.F90 @@ -31,7 +31,6 @@ MODULE mod_assimilation ! *** Variables specific for model setup *** REAL :: coords_l(2) !< Coordinates of local analysis domain - INTEGER, ALLOCATABLE :: id_lstate_in_pstate(:) !< Indices of local state vector in PE-local global state vector ! *** Variables to handle multiple fields in the state vector *** @@ -49,7 +48,7 @@ MODULE mod_assimilation ! Type variable holding field IDs in state vector TYPE(field_ids) :: id -!$OMP THREADPRIVATE(coords_l, id_lstate_in_pstate) +!$OMP THREADPRIVATE(coords_l) ! ----------------------------------------------------------------- @@ -74,18 +73,12 @@ MODULE mod_assimilation !< * (1) progress info !< * (2) add timings !< * (3) debugging output - INTEGER :: dim_ens !< Size of ensemble for SEIK/LSEIK/EnKF/ETKF \n - !< Number of EOFs to be used for SEEK + INTEGER :: dim_ens !< Size of ensemble INTEGER :: filtertype !< Select filter algorithm: - !< * SEEK (0), SEIK (1), EnKF (2), LSEIK (3), ETKF (4) + !< * SEIK (1), EnKF (2), LSEIK (3), ETKF (4) !< LETKF (5), ESTKF (6), LESTKF (7), NETF (9), LNETF (10) !< LKNETF (11), PF (12), GENOBS (100), 3DVAR (200) INTEGER :: subtype !< Subtype of filter algorithm - !< * SEEK: - !< (0) evolve normalized modes - !< (1) evolve scaled modes with unit U - !< (2) fixed basis (V); variable U matrix - !< (3) fixed covar matrix (V,U kept static) !< * SEIK: !< (0) ensemble forecast; new formulation !< (1) ensemble forecast; old formulation @@ -159,9 +152,6 @@ MODULE mod_assimilation !< (4) regulated localization of R with single-point error variance REAL :: sradius !< Support radius for 5th order polynomial !< or radius for 1/e for exponential weighting -! ! SEEK - INTEGER :: int_rediag !< Interval to perform re-diagonalization in SEEK - REAL :: epsilon !< Epsilon for gradient approx. in SEEK forecast ! ! ENKF INTEGER :: rank_ana_enkf !< Rank to be considered for inversion of HPH in analysis of EnKF !< (0) for analysis w/o eigendecomposition diff --git a/tutorial/3dvar/online_2D_serialmodel/parser_mpi.F90 b/tutorial/3dvar/online_2D_serialmodel/parser_mpi.F90 index 4269eed43..40258b6ac 100644 --- a/tutorial/3dvar/online_2D_serialmodel/parser_mpi.F90 +++ b/tutorial/3dvar/online_2D_serialmodel/parser_mpi.F90 @@ -47,12 +47,14 @@ !! to be specified as 'T' or 'F'. !! !! __Revision history:__ -!! * 2019-06 - Stephan Frickenhaus, Lars Nerger - Initial code +!! * 2003-02 - Stephan Frickenhaus, Lars Nerger - Initial code !! * Later revisions - see repository log !! MODULE parser use mpi + USE mod_parallel_pdaf, & + ONLY: abort_parallel IMPLICIT NONE SAVE @@ -187,6 +189,8 @@ SUBROUTINE parse_string(handle, charvalue) ! *** local variables *** CHARACTER(len=100) :: string CHARACTER(len=100) :: parsed_string + CHARACTER(len=110) :: str1_check + CHARACTER(len=110) :: str2_check LOGICAL :: modified ! *** Initialize *** @@ -206,9 +210,27 @@ SUBROUTINE parse_string(handle, charvalue) DO i = 1, command_argument_count() - 1 CALL get_command_argument(i, str1) CALL get_command_argument(i+1, str2) + + ! Add check for inadmissible strings longer than 100 + ! characters + CALL get_command_argument(i, str1_check) + CALL get_command_argument(i+1, str2_check) + IF (mype == 0) THEN + IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN + WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long." + WRITE (*,'(2x, a, 1x, a)') "called handle=", TRIM(string) + WRITE (*,'(2x, a, 1x, a)') "parsed handle=", TRIM(str1) + WRITE (*,'(2x, a, 1x, a)') "parsed input(cut)=", TRIM(str2) + call abort_parallel() + END IF + END IF + + #endif IF (str1 == TRIM(string)) THEN - READ(str2, *) parsed_string + ! Format specifier is needed for reading paths. Using + ! `*` as format specifier, reading stops at a `/` + READ(str2, '(a)') parsed_string modified = .TRUE. END IF ENDDO diff --git a/tutorial/classical/offline_2D_parallel/Makefile b/tutorial/classical/offline_2D_parallel/Makefile index 62cb630e9..9a10210c5 100644 --- a/tutorial/classical/offline_2D_parallel/Makefile +++ b/tutorial/classical/offline_2D_parallel/Makefile @@ -99,7 +99,7 @@ $(EXE) : libpdaf-d.a \ libpdaf-d.a: @echo "++++++ Generate Filter library ++++++" - @cd $(BASEDIR)/src; make; + @cd $(BASEDIR); make; ###################################################### @@ -123,7 +123,7 @@ clean : cleanpdaf: @echo "+++ Clean up PDAF directory" - cd $(BASEDIR)/src; make clean + cd $(BASEDIR); make clean cleandata: rm -f ens*ana.txt state_ana.txt diff --git a/tutorial/classical/offline_2D_parallel/dummympi/mpif.h b/tutorial/classical/offline_2D_parallel/dummympi/mpif.h deleted file mode 100644 index bce5f7650..000000000 --- a/tutorial/classical/offline_2D_parallel/dummympi/mpif.h +++ /dev/null @@ -1,14 +0,0 @@ -! This is a strongly reduced header file for those -! MPI variables used in PDAF MPI calls. This is only -! intended for compilation without a real MPI library. - - INTEGER MPI_STATUS_SIZE - PARAMETER (MPI_STATUS_SIZE=4) - - INTEGER MPI_INTEGER, MPI_REAL, MPI_DOUBLE_PRECISION - PARAMETER (MPI_REAL=26,MPI_DOUBLE_PRECISION=27,MPI_INTEGER=28) - - INTEGER MPI_COMM_WORLD - PARAMETER (MPI_COMM_WORLD=91) - - INTEGER MPI_SUM, MPI_MAX diff --git a/tutorial/classical/offline_2D_parallel/finalize_pdaf.F90 b/tutorial/classical/offline_2D_parallel/finalize_pdaf.F90 index 9c4cd494d..026673622 100644 --- a/tutorial/classical/offline_2D_parallel/finalize_pdaf.F90 +++ b/tutorial/classical/offline_2D_parallel/finalize_pdaf.F90 @@ -24,7 +24,7 @@ SUBROUTINE finalize_pdaf() !EOP ! *** Show allocated memory for PDAF *** - CALL PDAF_print_info(11) + IF (mype_world==0) CALL PDAF_print_info(10) ! *** Print PDAF timings onto screen *** IF (mype_world==0) CALL PDAF_print_info(3) diff --git a/tutorial/classical/offline_2D_parallel/parser_mpi.F90 b/tutorial/classical/offline_2D_parallel/parser_mpi.F90 index e4caa6f1a..603ab46c0 100644 --- a/tutorial/classical/offline_2D_parallel/parser_mpi.F90 +++ b/tutorial/classical/offline_2D_parallel/parser_mpi.F90 @@ -1,62 +1,60 @@ -!$Id: parser_mpi.F90 1581 2015-06-07 08:18:34Z lnerger $ -!BOP -! -! !MODULE: +!> Command line parser +!! +!! This module provides routine to parse command line +!! arguments of different types. This version is for +!! use with MPI parallelization. +!! +!! By default, this routine uses the intrinsics +!! 'get_command_count' and 'get_command_argument' +!! that are defined by the Fortran 2003 standard. +!! If a compiler does not support these functions, you +!! can use '-DF77' as a definition for the preprocessor. +!! In this case the Fortran77 standard 'iargc()' and +!! 'getarg()' are used. +!! +!! The module provides a generic subroutine to parse +!! variables of type INTEGER, REAL, or CHARACTER +!! (with length up to 100) from the command line. +!! +!! Usage: +!! SUBROUTINE PARSE(char(len=32) handle, variable) +!! The string 'handle' determines the name of +!! the parsed variable. +!! Example: handle='iters' parses a variable +!! specified on the command line by +!! '-iters value' +!! +!! Usage: +!! CALL PARSE(handle, int_variable) +!! Parses a variable of type integer +!! whose name is given by the string +!! handle. +!! +!! CALL PARSE(handle, real_variable) +!! Parses a variable of type real +!! whose name is given by the string +!! handle. +!! +!! CALL PARSE(handle, character_variable) +!! Parses a string variable of maxmimal +!! length of 100 characters whose name is +!! given by the string handle. +!! +!! CALL PARSE(handle, logical_variable) +!! Parses a variable of type logical +!! whose name is given by the string +!! handle. In the command line it has +!! to be specified as 'T' or 'F'. +!! +!! __Revision history:__ +!! * 2003-02 - Stephan Frickenhaus, Lars Nerger - Initial code +!! * Later revisions - see repository log +!! MODULE parser -! !DESCRIPTION: -! This module provides routine to parse command line -! arguments of different types. This version is for -! use with MPI parallelization. -! By default, this routine uses the intrinsics -! 'get\_command\_count' and 'get\_command\_argument' -! that are define by the Fortran 2003 standard. -! If a compiler does not support these functions, you -! can use '-DF77' as a definition for the preprocessor. -! In this case the Fortran77 standard 'iargc()' and -! 'getarg()' are used. -! -! The module provides a generic subroutine to parse -! variables of type INTEGER, REAL, or CHARACTER -! (with length up to 100) from the command line. -! -! Usage: \begin{verbatim} -! SUBROUTINE PARSE(char(len=32) handle, variable) -! The string 'handle' determines the name of -! the parsed variable. -! Example: handle='iters' parses a variable -! specified on the command line by -! '-iters value' -! -! Usage: -! CALL PARSE(handle, int_variable) -! Parses a variable of type integer -! whose name is given by the string -! handle. -! -! CALL PARSE(handle, real_variable) -! Parses a variable of type real -! whose name is given by the string -! handle. -! -! CALL PARSE(handle, character_variable) -! Parses a string variable of maxmimal -! length of 100 characters whose name is -! given by the string handle. -! -! CALL PARSE(handle, logical_variable) -! Parses a variable of type logical -! whose name is given by the string -! handle. In the command line it has -! to be specified as 'T' or 'F'. -! \end{verbatim} -! -! !REVISION HISTORY: -! 2003-02 - Stephan Frickenhaus, Lars Nerger - Initial code -! Later revisions - see svn log -! -! !USES: - USE mpi + use mpi + USE mod_parallel, & + ONLY: abort_parallel IMPLICIT NONE SAVE @@ -191,6 +189,8 @@ SUBROUTINE parse_string(handle, charvalue) ! *** local variables *** CHARACTER(len=100) :: string CHARACTER(len=100) :: parsed_string + CHARACTER(len=110) :: str1_check + CHARACTER(len=110) :: str2_check LOGICAL :: modified ! *** Initialize *** @@ -210,9 +210,27 @@ SUBROUTINE parse_string(handle, charvalue) DO i = 1, command_argument_count() - 1 CALL get_command_argument(i, str1) CALL get_command_argument(i+1, str2) + + ! Add check for inadmissible strings longer than 100 + ! characters + CALL get_command_argument(i, str1_check) + CALL get_command_argument(i+1, str2_check) + IF (mype == 0) THEN + IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN + WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long." + WRITE (*,'(2x, a, 1x, a)') "called handle=", TRIM(string) + WRITE (*,'(2x, a, 1x, a)') "parsed handle=", TRIM(str1) + WRITE (*,'(2x, a, 1x, a)') "parsed input(cut)=", TRIM(str2) + call abort_parallel() + END IF + END IF + + #endif IF (str1 == TRIM(string)) THEN - READ(str2, *) parsed_string + ! Format specifier is needed for reading paths. Using + ! `*` as format specifier, reading stops at a `/` + READ(str2, '(a)') parsed_string modified = .TRUE. END IF ENDDO diff --git a/tutorial/classical/offline_2D_serial/Makefile b/tutorial/classical/offline_2D_serial/Makefile index 89d43f1c0..9e2c5ffe2 100644 --- a/tutorial/classical/offline_2D_serial/Makefile +++ b/tutorial/classical/offline_2D_serial/Makefile @@ -99,7 +99,7 @@ $(EXE) : libpdaf-d.a \ libpdaf-d.a: @echo "++++++ Generate Filter library ++++++" - @cd $(BASEDIR)/src; make; + @cd $(BASEDIR); make; ###################################################### @@ -123,7 +123,7 @@ clean : cleanpdaf: @echo "+++ Clean up PDAF directory" - cd $(BASEDIR)/src; make clean + cd $(BASEDIR); make clean cleandata: rm -f ens*ana.txt state_ana.txt diff --git a/tutorial/classical/offline_2D_serial/init_dim_obs_l_pdaf.F90 b/tutorial/classical/offline_2D_serial/init_dim_obs_l_pdaf.F90 index b6642d253..a9b5569c6 100644 --- a/tutorial/classical/offline_2D_serial/init_dim_obs_l_pdaf.F90 +++ b/tutorial/classical/offline_2D_serial/init_dim_obs_l_pdaf.F90 @@ -98,4 +98,3 @@ SUBROUTINE init_dim_obs_l_pdaf(domain_p, step, dim_obs_f, dim_obs_l) END DO END SUBROUTINE init_dim_obs_l_pdaf - diff --git a/tutorial/classical/offline_2D_serial/init_pdaf_info.F90 b/tutorial/classical/offline_2D_serial/init_pdaf_info.F90 index a19decc2a..094a7e66b 100644 --- a/tutorial/classical/offline_2D_serial/init_pdaf_info.F90 +++ b/tutorial/classical/offline_2D_serial/init_pdaf_info.F90 @@ -21,7 +21,7 @@ SUBROUTINE init_pdaf_info() ! !USES: USE mod_assimilation, & ! Variables for assimilation ONLY: filtertype, subtype, dim_ens, delt_obs, model_error, & - model_err_amp, forget, rank_ana_enkf, int_rediag + model_err_amp, forget, rank_ana_enkf IMPLICIT NONE @@ -34,32 +34,7 @@ SUBROUTINE init_pdaf_info() ! *** Initial Screen output *** ! ***************************** - IF (filtertype == 0) THEN - WRITE (*, '(/21x, a)') 'Filter: SEEK' - IF (subtype == 2) THEN - WRITE (*, '(6x, a)') '-- fixed basis filter with update of matrix U' - WRITE (*, '(6x, a)') '-- no re-diagonalization of VUV^T' - ELSE IF (subtype == 3) THEN - WRITE (*, '(6x, a)') '-- fixed basis filter & no update of matrix U' - WRITE (*, '(6x, a)') '-- no re-diagonalization of VUV^T' - ELSE IF (subtype == 5) THEN - WRITE (*, '(6x, a)') '-- Offline mode' - END IF - WRITE (*, '(13x, a, i5)') 'number of EOFs:', dim_ens - IF (subtype /= 5) WRITE (*, '(6x, a, i5)') 'Assimilation interval:', delt_obs - WRITE (*, '(10x, a, f5.2)') 'forgetting factor:', forget - IF (subtype /= 5) THEN - IF ((int_rediag > 0) .AND. ((subtype /= 2) .OR. (subtype /= 3))) & - WRITE (*, '(10x, a, i4, a)') & - 'Re-diag each ', int_rediag, '-th analysis step' - ELSE - IF (int_rediag == 1) THEN - WRITE (*, '(10x, a)') 'Perform re-diagonalization' - ELSE - WRITE (*, '(10x, a)') 'No re-diagonalization' - END IF - END IF - ELSE IF (filtertype == 1) THEN + IF (filtertype == 1) THEN WRITE (*, '(21x, a)') 'Filter: SEIK' IF (subtype == 2) THEN WRITE (*, '(6x, a)') '-- fixed error-space basis' diff --git a/tutorial/classical/offline_2D_serial/init_pdaf_parse.F90 b/tutorial/classical/offline_2D_serial/init_pdaf_parse.F90 index 7f2183d36..51fb6a164 100644 --- a/tutorial/classical/offline_2D_serial/init_pdaf_parse.F90 +++ b/tutorial/classical/offline_2D_serial/init_pdaf_parse.F90 @@ -23,8 +23,8 @@ SUBROUTINE init_pdaf_parse() USE mod_assimilation, & ! Variables for assimilation ONLY: screen, filtertype, subtype, dim_ens, delt_obs, & rms_obs, model_error, model_err_amp, incremental, type_forget, & - forget, epsilon, rank_ana_enkf, locweight, cradius, & - sradius, int_rediag, filename, type_trans, dim_obs, & + forget, rank_ana_enkf, locweight, cradius, & + sradius, filename, type_trans, dim_obs, & type_sqrt IMPLICIT NONE @@ -71,10 +71,6 @@ SUBROUTINE init_pdaf_parse() ! Filter-specific settings handle = 'type_trans' ! Type of ensemble transformation in SEIK/ETKF/LSEIK/LETKF CALL parse(handle, type_trans) - handle = 'epsilon' ! Set EPSILON for SEEK - CALL parse(handle, epsilon) - handle = 'int_rediag' ! Time step interval for rediagonalization in SEEK - CALL parse(handle, int_rediag) handle = 'rank_ana_enkf' ! Set rank for pseudo inverse in EnKF CALL parse(handle, rank_ana_enkf) handle = 'type_forget' ! Set type of forgetting factor diff --git a/tutorial/classical/offline_2D_serial/parser_mpi.F90 b/tutorial/classical/offline_2D_serial/parser_mpi.F90 index e4caa6f1a..603ab46c0 100644 --- a/tutorial/classical/offline_2D_serial/parser_mpi.F90 +++ b/tutorial/classical/offline_2D_serial/parser_mpi.F90 @@ -1,62 +1,60 @@ -!$Id: parser_mpi.F90 1581 2015-06-07 08:18:34Z lnerger $ -!BOP -! -! !MODULE: +!> Command line parser +!! +!! This module provides routine to parse command line +!! arguments of different types. This version is for +!! use with MPI parallelization. +!! +!! By default, this routine uses the intrinsics +!! 'get_command_count' and 'get_command_argument' +!! that are defined by the Fortran 2003 standard. +!! If a compiler does not support these functions, you +!! can use '-DF77' as a definition for the preprocessor. +!! In this case the Fortran77 standard 'iargc()' and +!! 'getarg()' are used. +!! +!! The module provides a generic subroutine to parse +!! variables of type INTEGER, REAL, or CHARACTER +!! (with length up to 100) from the command line. +!! +!! Usage: +!! SUBROUTINE PARSE(char(len=32) handle, variable) +!! The string 'handle' determines the name of +!! the parsed variable. +!! Example: handle='iters' parses a variable +!! specified on the command line by +!! '-iters value' +!! +!! Usage: +!! CALL PARSE(handle, int_variable) +!! Parses a variable of type integer +!! whose name is given by the string +!! handle. +!! +!! CALL PARSE(handle, real_variable) +!! Parses a variable of type real +!! whose name is given by the string +!! handle. +!! +!! CALL PARSE(handle, character_variable) +!! Parses a string variable of maxmimal +!! length of 100 characters whose name is +!! given by the string handle. +!! +!! CALL PARSE(handle, logical_variable) +!! Parses a variable of type logical +!! whose name is given by the string +!! handle. In the command line it has +!! to be specified as 'T' or 'F'. +!! +!! __Revision history:__ +!! * 2003-02 - Stephan Frickenhaus, Lars Nerger - Initial code +!! * Later revisions - see repository log +!! MODULE parser -! !DESCRIPTION: -! This module provides routine to parse command line -! arguments of different types. This version is for -! use with MPI parallelization. -! By default, this routine uses the intrinsics -! 'get\_command\_count' and 'get\_command\_argument' -! that are define by the Fortran 2003 standard. -! If a compiler does not support these functions, you -! can use '-DF77' as a definition for the preprocessor. -! In this case the Fortran77 standard 'iargc()' and -! 'getarg()' are used. -! -! The module provides a generic subroutine to parse -! variables of type INTEGER, REAL, or CHARACTER -! (with length up to 100) from the command line. -! -! Usage: \begin{verbatim} -! SUBROUTINE PARSE(char(len=32) handle, variable) -! The string 'handle' determines the name of -! the parsed variable. -! Example: handle='iters' parses a variable -! specified on the command line by -! '-iters value' -! -! Usage: -! CALL PARSE(handle, int_variable) -! Parses a variable of type integer -! whose name is given by the string -! handle. -! -! CALL PARSE(handle, real_variable) -! Parses a variable of type real -! whose name is given by the string -! handle. -! -! CALL PARSE(handle, character_variable) -! Parses a string variable of maxmimal -! length of 100 characters whose name is -! given by the string handle. -! -! CALL PARSE(handle, logical_variable) -! Parses a variable of type logical -! whose name is given by the string -! handle. In the command line it has -! to be specified as 'T' or 'F'. -! \end{verbatim} -! -! !REVISION HISTORY: -! 2003-02 - Stephan Frickenhaus, Lars Nerger - Initial code -! Later revisions - see svn log -! -! !USES: - USE mpi + use mpi + USE mod_parallel, & + ONLY: abort_parallel IMPLICIT NONE SAVE @@ -191,6 +189,8 @@ SUBROUTINE parse_string(handle, charvalue) ! *** local variables *** CHARACTER(len=100) :: string CHARACTER(len=100) :: parsed_string + CHARACTER(len=110) :: str1_check + CHARACTER(len=110) :: str2_check LOGICAL :: modified ! *** Initialize *** @@ -210,9 +210,27 @@ SUBROUTINE parse_string(handle, charvalue) DO i = 1, command_argument_count() - 1 CALL get_command_argument(i, str1) CALL get_command_argument(i+1, str2) + + ! Add check for inadmissible strings longer than 100 + ! characters + CALL get_command_argument(i, str1_check) + CALL get_command_argument(i+1, str2_check) + IF (mype == 0) THEN + IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN + WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long." + WRITE (*,'(2x, a, 1x, a)') "called handle=", TRIM(string) + WRITE (*,'(2x, a, 1x, a)') "parsed handle=", TRIM(str1) + WRITE (*,'(2x, a, 1x, a)') "parsed input(cut)=", TRIM(str2) + call abort_parallel() + END IF + END IF + + #endif IF (str1 == TRIM(string)) THEN - READ(str2, *) parsed_string + ! Format specifier is needed for reading paths. Using + ! `*` as format specifier, reading stops at a `/` + READ(str2, '(a)') parsed_string modified = .TRUE. END IF ENDDO diff --git a/tutorial/classical/online_2D_parallelmodel/Makefile b/tutorial/classical/online_2D_parallelmodel/Makefile index aa5f5ddc4..ef360aea0 100644 --- a/tutorial/classical/online_2D_parallelmodel/Makefile +++ b/tutorial/classical/online_2D_parallelmodel/Makefile @@ -121,7 +121,7 @@ model_pdaf : libpdaf-d.a \ libpdaf-d.a: @echo "++++++ Generate Filter library ++++++" - @cd $(BASEDIR)/src; make; + @cd $(BASEDIR); make; ###################################################### @@ -146,7 +146,7 @@ clean : cleanpdaf: @echo "+++ Clean up PDAF directory" - cd $(BASEDIR)/src; make clean + cd $(BASEDIR); make clean cleandata: rm -f ens*ana.txt ens*for.txt state_*ana.txt state_*for.txt diff --git a/tutorial/classical/online_2D_parallelmodel/parser_mpi.F90 b/tutorial/classical/online_2D_parallelmodel/parser_mpi.F90 index e4caa6f1a..6ddcbb65d 100644 --- a/tutorial/classical/online_2D_parallelmodel/parser_mpi.F90 +++ b/tutorial/classical/online_2D_parallelmodel/parser_mpi.F90 @@ -1,62 +1,60 @@ -!$Id: parser_mpi.F90 1581 2015-06-07 08:18:34Z lnerger $ -!BOP -! -! !MODULE: +!> Command line parser +!! +!! This module provides routine to parse command line +!! arguments of different types. This version is for +!! use with MPI parallelization. +!! +!! By default, this routine uses the intrinsics +!! 'get_command_count' and 'get_command_argument' +!! that are defined by the Fortran 2003 standard. +!! If a compiler does not support these functions, you +!! can use '-DF77' as a definition for the preprocessor. +!! In this case the Fortran77 standard 'iargc()' and +!! 'getarg()' are used. +!! +!! The module provides a generic subroutine to parse +!! variables of type INTEGER, REAL, or CHARACTER +!! (with length up to 100) from the command line. +!! +!! Usage: +!! SUBROUTINE PARSE(char(len=32) handle, variable) +!! The string 'handle' determines the name of +!! the parsed variable. +!! Example: handle='iters' parses a variable +!! specified on the command line by +!! '-iters value' +!! +!! Usage: +!! CALL PARSE(handle, int_variable) +!! Parses a variable of type integer +!! whose name is given by the string +!! handle. +!! +!! CALL PARSE(handle, real_variable) +!! Parses a variable of type real +!! whose name is given by the string +!! handle. +!! +!! CALL PARSE(handle, character_variable) +!! Parses a string variable of maxmimal +!! length of 100 characters whose name is +!! given by the string handle. +!! +!! CALL PARSE(handle, logical_variable) +!! Parses a variable of type logical +!! whose name is given by the string +!! handle. In the command line it has +!! to be specified as 'T' or 'F'. +!! +!! __Revision history:__ +!! * 2003-02 - Stephan Frickenhaus, Lars Nerger - Initial code +!! * Later revisions - see repository log +!! MODULE parser -! !DESCRIPTION: -! This module provides routine to parse command line -! arguments of different types. This version is for -! use with MPI parallelization. -! By default, this routine uses the intrinsics -! 'get\_command\_count' and 'get\_command\_argument' -! that are define by the Fortran 2003 standard. -! If a compiler does not support these functions, you -! can use '-DF77' as a definition for the preprocessor. -! In this case the Fortran77 standard 'iargc()' and -! 'getarg()' are used. -! -! The module provides a generic subroutine to parse -! variables of type INTEGER, REAL, or CHARACTER -! (with length up to 100) from the command line. -! -! Usage: \begin{verbatim} -! SUBROUTINE PARSE(char(len=32) handle, variable) -! The string 'handle' determines the name of -! the parsed variable. -! Example: handle='iters' parses a variable -! specified on the command line by -! '-iters value' -! -! Usage: -! CALL PARSE(handle, int_variable) -! Parses a variable of type integer -! whose name is given by the string -! handle. -! -! CALL PARSE(handle, real_variable) -! Parses a variable of type real -! whose name is given by the string -! handle. -! -! CALL PARSE(handle, character_variable) -! Parses a string variable of maxmimal -! length of 100 characters whose name is -! given by the string handle. -! -! CALL PARSE(handle, logical_variable) -! Parses a variable of type logical -! whose name is given by the string -! handle. In the command line it has -! to be specified as 'T' or 'F'. -! \end{verbatim} -! -! !REVISION HISTORY: -! 2003-02 - Stephan Frickenhaus, Lars Nerger - Initial code -! Later revisions - see svn log -! -! !USES: - USE mpi + use mpi + USE mod_parallel_model, & + ONLY: abort_parallel IMPLICIT NONE SAVE @@ -191,6 +189,8 @@ SUBROUTINE parse_string(handle, charvalue) ! *** local variables *** CHARACTER(len=100) :: string CHARACTER(len=100) :: parsed_string + CHARACTER(len=110) :: str1_check + CHARACTER(len=110) :: str2_check LOGICAL :: modified ! *** Initialize *** @@ -210,9 +210,27 @@ SUBROUTINE parse_string(handle, charvalue) DO i = 1, command_argument_count() - 1 CALL get_command_argument(i, str1) CALL get_command_argument(i+1, str2) + + ! Add check for inadmissible strings longer than 100 + ! characters + CALL get_command_argument(i, str1_check) + CALL get_command_argument(i+1, str2_check) + IF (mype == 0) THEN + IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN + WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long." + WRITE (*,'(2x, a, 1x, a)') "called handle=", TRIM(string) + WRITE (*,'(2x, a, 1x, a)') "parsed handle=", TRIM(str1) + WRITE (*,'(2x, a, 1x, a)') "parsed input(cut)=", TRIM(str2) + call abort_parallel() + END IF + END IF + + #endif IF (str1 == TRIM(string)) THEN - READ(str2, *) parsed_string + ! Format specifier is needed for reading paths. Using + ! `*` as format specifier, reading stops at a `/` + READ(str2, '(a)') parsed_string modified = .TRUE. END IF ENDDO diff --git a/tutorial/classical/online_2D_parallelmodel_fullpar/Makefile b/tutorial/classical/online_2D_parallelmodel_fullpar/Makefile index 022d0672d..3a6136ddf 100644 --- a/tutorial/classical/online_2D_parallelmodel_fullpar/Makefile +++ b/tutorial/classical/online_2D_parallelmodel_fullpar/Makefile @@ -121,7 +121,7 @@ model_pdaf : libpdaf-d.a \ libpdaf-d.a: @echo "++++++ Generate Filter library ++++++" - @cd $(BASEDIR)/src; make; + @cd $(BASEDIR); make; ###################################################### @@ -144,7 +144,7 @@ clean : cleanpdaf: @echo "+++ Clean up PDAF directory" - cd $(BASEDIR)/src; make clean + cd $(BASEDIR); make clean cleandata: rm -f ens*ana.txt ens*for.txt state_*ana.txt state_*for.txt diff --git a/tutorial/classical/online_2D_parallelmodel_fullpar/parser_mpi.F90 b/tutorial/classical/online_2D_parallelmodel_fullpar/parser_mpi.F90 index e4caa6f1a..6ddcbb65d 100644 --- a/tutorial/classical/online_2D_parallelmodel_fullpar/parser_mpi.F90 +++ b/tutorial/classical/online_2D_parallelmodel_fullpar/parser_mpi.F90 @@ -1,62 +1,60 @@ -!$Id: parser_mpi.F90 1581 2015-06-07 08:18:34Z lnerger $ -!BOP -! -! !MODULE: +!> Command line parser +!! +!! This module provides routine to parse command line +!! arguments of different types. This version is for +!! use with MPI parallelization. +!! +!! By default, this routine uses the intrinsics +!! 'get_command_count' and 'get_command_argument' +!! that are defined by the Fortran 2003 standard. +!! If a compiler does not support these functions, you +!! can use '-DF77' as a definition for the preprocessor. +!! In this case the Fortran77 standard 'iargc()' and +!! 'getarg()' are used. +!! +!! The module provides a generic subroutine to parse +!! variables of type INTEGER, REAL, or CHARACTER +!! (with length up to 100) from the command line. +!! +!! Usage: +!! SUBROUTINE PARSE(char(len=32) handle, variable) +!! The string 'handle' determines the name of +!! the parsed variable. +!! Example: handle='iters' parses a variable +!! specified on the command line by +!! '-iters value' +!! +!! Usage: +!! CALL PARSE(handle, int_variable) +!! Parses a variable of type integer +!! whose name is given by the string +!! handle. +!! +!! CALL PARSE(handle, real_variable) +!! Parses a variable of type real +!! whose name is given by the string +!! handle. +!! +!! CALL PARSE(handle, character_variable) +!! Parses a string variable of maxmimal +!! length of 100 characters whose name is +!! given by the string handle. +!! +!! CALL PARSE(handle, logical_variable) +!! Parses a variable of type logical +!! whose name is given by the string +!! handle. In the command line it has +!! to be specified as 'T' or 'F'. +!! +!! __Revision history:__ +!! * 2003-02 - Stephan Frickenhaus, Lars Nerger - Initial code +!! * Later revisions - see repository log +!! MODULE parser -! !DESCRIPTION: -! This module provides routine to parse command line -! arguments of different types. This version is for -! use with MPI parallelization. -! By default, this routine uses the intrinsics -! 'get\_command\_count' and 'get\_command\_argument' -! that are define by the Fortran 2003 standard. -! If a compiler does not support these functions, you -! can use '-DF77' as a definition for the preprocessor. -! In this case the Fortran77 standard 'iargc()' and -! 'getarg()' are used. -! -! The module provides a generic subroutine to parse -! variables of type INTEGER, REAL, or CHARACTER -! (with length up to 100) from the command line. -! -! Usage: \begin{verbatim} -! SUBROUTINE PARSE(char(len=32) handle, variable) -! The string 'handle' determines the name of -! the parsed variable. -! Example: handle='iters' parses a variable -! specified on the command line by -! '-iters value' -! -! Usage: -! CALL PARSE(handle, int_variable) -! Parses a variable of type integer -! whose name is given by the string -! handle. -! -! CALL PARSE(handle, real_variable) -! Parses a variable of type real -! whose name is given by the string -! handle. -! -! CALL PARSE(handle, character_variable) -! Parses a string variable of maxmimal -! length of 100 characters whose name is -! given by the string handle. -! -! CALL PARSE(handle, logical_variable) -! Parses a variable of type logical -! whose name is given by the string -! handle. In the command line it has -! to be specified as 'T' or 'F'. -! \end{verbatim} -! -! !REVISION HISTORY: -! 2003-02 - Stephan Frickenhaus, Lars Nerger - Initial code -! Later revisions - see svn log -! -! !USES: - USE mpi + use mpi + USE mod_parallel_model, & + ONLY: abort_parallel IMPLICIT NONE SAVE @@ -191,6 +189,8 @@ SUBROUTINE parse_string(handle, charvalue) ! *** local variables *** CHARACTER(len=100) :: string CHARACTER(len=100) :: parsed_string + CHARACTER(len=110) :: str1_check + CHARACTER(len=110) :: str2_check LOGICAL :: modified ! *** Initialize *** @@ -210,9 +210,27 @@ SUBROUTINE parse_string(handle, charvalue) DO i = 1, command_argument_count() - 1 CALL get_command_argument(i, str1) CALL get_command_argument(i+1, str2) + + ! Add check for inadmissible strings longer than 100 + ! characters + CALL get_command_argument(i, str1_check) + CALL get_command_argument(i+1, str2_check) + IF (mype == 0) THEN + IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN + WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long." + WRITE (*,'(2x, a, 1x, a)') "called handle=", TRIM(string) + WRITE (*,'(2x, a, 1x, a)') "parsed handle=", TRIM(str1) + WRITE (*,'(2x, a, 1x, a)') "parsed input(cut)=", TRIM(str2) + call abort_parallel() + END IF + END IF + + #endif IF (str1 == TRIM(string)) THEN - READ(str2, *) parsed_string + ! Format specifier is needed for reading paths. Using + ! `*` as format specifier, reading stops at a `/` + READ(str2, '(a)') parsed_string modified = .TRUE. END IF ENDDO diff --git a/tutorial/classical/online_2D_parallelmodel_fullpar_1fpe/Makefile b/tutorial/classical/online_2D_parallelmodel_fullpar_1fpe/Makefile index 1c3c1ef74..9d3170e1a 100644 --- a/tutorial/classical/online_2D_parallelmodel_fullpar_1fpe/Makefile +++ b/tutorial/classical/online_2D_parallelmodel_fullpar_1fpe/Makefile @@ -121,7 +121,7 @@ model_pdaf : libpdaf-d.a \ libpdaf-d.a: @echo "++++++ Generate Filter library ++++++" - @cd $(BASEDIR)/src; make; + @cd $(BASEDIR); make; ###################################################### @@ -143,7 +143,7 @@ clean : cleanpdaf: @echo "+++ Clean up PDAF directory" - cd $(BASEDIR)/src; make clean + cd $(BASEDIR); make clean cleandata: rm -f ens*ana.txt ens*for.txt state_*ana.txt state_*for.txt diff --git a/tutorial/classical/online_2D_parallelmodel_fullpar_1fpe/parser_mpi.F90 b/tutorial/classical/online_2D_parallelmodel_fullpar_1fpe/parser_mpi.F90 index e4caa6f1a..6ddcbb65d 100644 --- a/tutorial/classical/online_2D_parallelmodel_fullpar_1fpe/parser_mpi.F90 +++ b/tutorial/classical/online_2D_parallelmodel_fullpar_1fpe/parser_mpi.F90 @@ -1,62 +1,60 @@ -!$Id: parser_mpi.F90 1581 2015-06-07 08:18:34Z lnerger $ -!BOP -! -! !MODULE: +!> Command line parser +!! +!! This module provides routine to parse command line +!! arguments of different types. This version is for +!! use with MPI parallelization. +!! +!! By default, this routine uses the intrinsics +!! 'get_command_count' and 'get_command_argument' +!! that are defined by the Fortran 2003 standard. +!! If a compiler does not support these functions, you +!! can use '-DF77' as a definition for the preprocessor. +!! In this case the Fortran77 standard 'iargc()' and +!! 'getarg()' are used. +!! +!! The module provides a generic subroutine to parse +!! variables of type INTEGER, REAL, or CHARACTER +!! (with length up to 100) from the command line. +!! +!! Usage: +!! SUBROUTINE PARSE(char(len=32) handle, variable) +!! The string 'handle' determines the name of +!! the parsed variable. +!! Example: handle='iters' parses a variable +!! specified on the command line by +!! '-iters value' +!! +!! Usage: +!! CALL PARSE(handle, int_variable) +!! Parses a variable of type integer +!! whose name is given by the string +!! handle. +!! +!! CALL PARSE(handle, real_variable) +!! Parses a variable of type real +!! whose name is given by the string +!! handle. +!! +!! CALL PARSE(handle, character_variable) +!! Parses a string variable of maxmimal +!! length of 100 characters whose name is +!! given by the string handle. +!! +!! CALL PARSE(handle, logical_variable) +!! Parses a variable of type logical +!! whose name is given by the string +!! handle. In the command line it has +!! to be specified as 'T' or 'F'. +!! +!! __Revision history:__ +!! * 2003-02 - Stephan Frickenhaus, Lars Nerger - Initial code +!! * Later revisions - see repository log +!! MODULE parser -! !DESCRIPTION: -! This module provides routine to parse command line -! arguments of different types. This version is for -! use with MPI parallelization. -! By default, this routine uses the intrinsics -! 'get\_command\_count' and 'get\_command\_argument' -! that are define by the Fortran 2003 standard. -! If a compiler does not support these functions, you -! can use '-DF77' as a definition for the preprocessor. -! In this case the Fortran77 standard 'iargc()' and -! 'getarg()' are used. -! -! The module provides a generic subroutine to parse -! variables of type INTEGER, REAL, or CHARACTER -! (with length up to 100) from the command line. -! -! Usage: \begin{verbatim} -! SUBROUTINE PARSE(char(len=32) handle, variable) -! The string 'handle' determines the name of -! the parsed variable. -! Example: handle='iters' parses a variable -! specified on the command line by -! '-iters value' -! -! Usage: -! CALL PARSE(handle, int_variable) -! Parses a variable of type integer -! whose name is given by the string -! handle. -! -! CALL PARSE(handle, real_variable) -! Parses a variable of type real -! whose name is given by the string -! handle. -! -! CALL PARSE(handle, character_variable) -! Parses a string variable of maxmimal -! length of 100 characters whose name is -! given by the string handle. -! -! CALL PARSE(handle, logical_variable) -! Parses a variable of type logical -! whose name is given by the string -! handle. In the command line it has -! to be specified as 'T' or 'F'. -! \end{verbatim} -! -! !REVISION HISTORY: -! 2003-02 - Stephan Frickenhaus, Lars Nerger - Initial code -! Later revisions - see svn log -! -! !USES: - USE mpi + use mpi + USE mod_parallel_model, & + ONLY: abort_parallel IMPLICIT NONE SAVE @@ -191,6 +189,8 @@ SUBROUTINE parse_string(handle, charvalue) ! *** local variables *** CHARACTER(len=100) :: string CHARACTER(len=100) :: parsed_string + CHARACTER(len=110) :: str1_check + CHARACTER(len=110) :: str2_check LOGICAL :: modified ! *** Initialize *** @@ -210,9 +210,27 @@ SUBROUTINE parse_string(handle, charvalue) DO i = 1, command_argument_count() - 1 CALL get_command_argument(i, str1) CALL get_command_argument(i+1, str2) + + ! Add check for inadmissible strings longer than 100 + ! characters + CALL get_command_argument(i, str1_check) + CALL get_command_argument(i+1, str2_check) + IF (mype == 0) THEN + IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN + WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long." + WRITE (*,'(2x, a, 1x, a)') "called handle=", TRIM(string) + WRITE (*,'(2x, a, 1x, a)') "parsed handle=", TRIM(str1) + WRITE (*,'(2x, a, 1x, a)') "parsed input(cut)=", TRIM(str2) + call abort_parallel() + END IF + END IF + + #endif IF (str1 == TRIM(string)) THEN - READ(str2, *) parsed_string + ! Format specifier is needed for reading paths. Using + ! `*` as format specifier, reading stops at a `/` + READ(str2, '(a)') parsed_string modified = .TRUE. END IF ENDDO diff --git a/tutorial/classical/online_2D_serialmodel/Makefile b/tutorial/classical/online_2D_serialmodel/Makefile index c7b398705..20b935ece 100644 --- a/tutorial/classical/online_2D_serialmodel/Makefile +++ b/tutorial/classical/online_2D_serialmodel/Makefile @@ -119,7 +119,7 @@ model_pdaf : libpdaf-d.a \ libpdaf-d.a: @echo "++++++ Generate Filter library ++++++" - @cd $(BASEDIR)/src; make; + @cd $(BASEDIR); make; ###################################################### @@ -144,7 +144,7 @@ clean : cleanpdaf: @echo "+++ Clean up PDAF directory" - cd $(BASEDIR)/src; make clean + cd $(BASEDIR); make clean cleandata: rm -f ens*ana.txt ens*for.txt state_*ana.txt state_*for.txt true*.txt diff --git a/tutorial/classical/online_2D_serialmodel/parser_mpi.F90 b/tutorial/classical/online_2D_serialmodel/parser_mpi.F90 index e4caa6f1a..40258b6ac 100644 --- a/tutorial/classical/online_2D_serialmodel/parser_mpi.F90 +++ b/tutorial/classical/online_2D_serialmodel/parser_mpi.F90 @@ -1,62 +1,60 @@ -!$Id: parser_mpi.F90 1581 2015-06-07 08:18:34Z lnerger $ -!BOP -! -! !MODULE: +!> Command line parser +!! +!! This module provides routine to parse command line +!! arguments of different types. This version is for +!! use with MPI parallelization. +!! +!! By default, this routine uses the intrinsics +!! 'get_command_count' and 'get_command_argument' +!! that are defined by the Fortran 2003 standard. +!! If a compiler does not support these functions, you +!! can use '-DF77' as a definition for the preprocessor. +!! In this case the Fortran77 standard 'iargc()' and +!! 'getarg()' are used. +!! +!! The module provides a generic subroutine to parse +!! variables of type INTEGER, REAL, or CHARACTER +!! (with length up to 100) from the command line. +!! +!! Usage: +!! SUBROUTINE PARSE(char(len=32) handle, variable) +!! The string 'handle' determines the name of +!! the parsed variable. +!! Example: handle='iters' parses a variable +!! specified on the command line by +!! '-iters value' +!! +!! Usage: +!! CALL PARSE(handle, int_variable) +!! Parses a variable of type integer +!! whose name is given by the string +!! handle. +!! +!! CALL PARSE(handle, real_variable) +!! Parses a variable of type real +!! whose name is given by the string +!! handle. +!! +!! CALL PARSE(handle, character_variable) +!! Parses a string variable of maxmimal +!! length of 100 characters whose name is +!! given by the string handle. +!! +!! CALL PARSE(handle, logical_variable) +!! Parses a variable of type logical +!! whose name is given by the string +!! handle. In the command line it has +!! to be specified as 'T' or 'F'. +!! +!! __Revision history:__ +!! * 2003-02 - Stephan Frickenhaus, Lars Nerger - Initial code +!! * Later revisions - see repository log +!! MODULE parser -! !DESCRIPTION: -! This module provides routine to parse command line -! arguments of different types. This version is for -! use with MPI parallelization. -! By default, this routine uses the intrinsics -! 'get\_command\_count' and 'get\_command\_argument' -! that are define by the Fortran 2003 standard. -! If a compiler does not support these functions, you -! can use '-DF77' as a definition for the preprocessor. -! In this case the Fortran77 standard 'iargc()' and -! 'getarg()' are used. -! -! The module provides a generic subroutine to parse -! variables of type INTEGER, REAL, or CHARACTER -! (with length up to 100) from the command line. -! -! Usage: \begin{verbatim} -! SUBROUTINE PARSE(char(len=32) handle, variable) -! The string 'handle' determines the name of -! the parsed variable. -! Example: handle='iters' parses a variable -! specified on the command line by -! '-iters value' -! -! Usage: -! CALL PARSE(handle, int_variable) -! Parses a variable of type integer -! whose name is given by the string -! handle. -! -! CALL PARSE(handle, real_variable) -! Parses a variable of type real -! whose name is given by the string -! handle. -! -! CALL PARSE(handle, character_variable) -! Parses a string variable of maxmimal -! length of 100 characters whose name is -! given by the string handle. -! -! CALL PARSE(handle, logical_variable) -! Parses a variable of type logical -! whose name is given by the string -! handle. In the command line it has -! to be specified as 'T' or 'F'. -! \end{verbatim} -! -! !REVISION HISTORY: -! 2003-02 - Stephan Frickenhaus, Lars Nerger - Initial code -! Later revisions - see svn log -! -! !USES: - USE mpi + use mpi + USE mod_parallel_pdaf, & + ONLY: abort_parallel IMPLICIT NONE SAVE @@ -191,6 +189,8 @@ SUBROUTINE parse_string(handle, charvalue) ! *** local variables *** CHARACTER(len=100) :: string CHARACTER(len=100) :: parsed_string + CHARACTER(len=110) :: str1_check + CHARACTER(len=110) :: str2_check LOGICAL :: modified ! *** Initialize *** @@ -210,9 +210,27 @@ SUBROUTINE parse_string(handle, charvalue) DO i = 1, command_argument_count() - 1 CALL get_command_argument(i, str1) CALL get_command_argument(i+1, str2) + + ! Add check for inadmissible strings longer than 100 + ! characters + CALL get_command_argument(i, str1_check) + CALL get_command_argument(i+1, str2_check) + IF (mype == 0) THEN + IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN + WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long." + WRITE (*,'(2x, a, 1x, a)') "called handle=", TRIM(string) + WRITE (*,'(2x, a, 1x, a)') "parsed handle=", TRIM(str1) + WRITE (*,'(2x, a, 1x, a)') "parsed input(cut)=", TRIM(str2) + call abort_parallel() + END IF + END IF + + #endif IF (str1 == TRIM(string)) THEN - READ(str2, *) parsed_string + ! Format specifier is needed for reading paths. Using + ! `*` as format specifier, reading stops at a `/` + READ(str2, '(a)') parsed_string modified = .TRUE. END IF ENDDO diff --git a/tutorial/offline_2D_parallel/Makefile b/tutorial/offline_2D_parallel/Makefile index c1fc8332a..661cdd406 100644 --- a/tutorial/offline_2D_parallel/Makefile +++ b/tutorial/offline_2D_parallel/Makefile @@ -65,9 +65,7 @@ OBJ_USER_GEN = init_ens_offline.o \ # User-supplied routines for localized analysis OBJ_USER_LOCAL = init_n_domains_pdaf.o \ - init_dim_l_pdaf.o \ - g2l_state_pdaf.o \ - l2g_state_pdaf.o + init_dim_l_pdaf.o # Full list of user-supplied routines for online modes OBJ_PDAF_USER = $(OBJ_USER_PDAFOMI) $(OBJ_USER_GEN) $(OBJ_USER_LOCAL) @@ -86,7 +84,7 @@ $(EXE) : libpdaf-d.a \ libpdaf-d.a: @echo "++++++ Generate Filter library ++++++" - @cd $(BASEDIR)/src; make; + @cd $(BASEDIR); make; ###################################################### @@ -110,7 +108,7 @@ clean : cleanpdaf: @echo "+++ Clean up PDAF directory" - cd $(BASEDIR)/src; make clean + cd $(BASEDIR); make clean cleandata: rm -f ens*ana.txt state_ana.txt diff --git a/tutorial/offline_2D_parallel/assimilate_pdaf_offline.F90 b/tutorial/offline_2D_parallel/assimilate_pdaf_offline.F90 index bfb31e2ea..a75f7687f 100644 --- a/tutorial/offline_2D_parallel/assimilate_pdaf_offline.F90 +++ b/tutorial/offline_2D_parallel/assimilate_pdaf_offline.F90 @@ -1,9 +1,9 @@ !> Routine to call PDAF for analysis step !! !! This routine performs a single analysis step in the -!! offline implementation. For this, it calls the -!! filter-specific assimilation routine of PDAF -!! (PDAF_assimilate_X or PDAF_put_state_X) +!! offline implementation of PDAF. For this, it calls the +!! filter-specific assimilation routine of PDAF. For the +!! offline implementation this is PDAF_put_state_X. !! !! In this routine, the real names of most of the !! user-supplied routines for PDAF are specified (see below). @@ -15,9 +15,11 @@ SUBROUTINE assimilate_pdaf_offline() USE PDAF_interfaces_module, & ! Interface definitions to PDAF core routines - ONLY: PDAFomi_assimilate_local, PDAFomi_assimilate_global, & - PDAFomi_assimilate_lenkf, PDAF_get_localfilter - USE mod_parallel_pdaf, & ! Parallelization + ONLY: PDAFomi_put_state_global, & + PDAFomi_put_state_lenkf, PDAF_get_localfilter + USE PDAFlocal, & ! Interface definitions for PDAFlocal + ONLY: PDAFlocalomi_put_state + USE mod_parallel_pdaf, & ! Parallelization ONLY: mype_world, abort_parallel USE mod_assimilation, & ! Variables for assimilation ONLY: filtertype @@ -43,9 +45,7 @@ SUBROUTINE assimilate_pdaf_offline() prepoststep_ens_offline ! User supplied pre/poststep routine ! Localization of state vector EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains - init_dim_l_pdaf, & ! Initialize state dimension for local analysis domain - g2l_state_pdaf, & ! Get state on local analysis domain from global state - l2g_state_pdaf ! Update global state from state on local analysis domain + init_dim_l_pdaf ! Initialize state dimension for local analysis domain ! Interface to PDAF-OMI for local and global filters EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain @@ -62,24 +62,25 @@ SUBROUTINE assimilate_pdaf_offline() ! *** PDAF_get_state is not required as no forecasting *** ! *** is performed in this mode. However, it is save *** ! *** to call PDAF_get_state, even it is not necessary. *** -! *** The functionality of PDAF_get_state is deactived *** +! *** The functionality of PDAF_get_state is deactivated *** ! *** for the offline mode. *** ! Check whether the filter is domain-localized CALL PDAF_get_localfilter(localfilter) ! Call assimilate routine for global or local filter - IF (localfilter==1) THEN - CALL PDAFomi_put_state_local(collect_state_pdaf, init_dim_obs_pdafomi, & + IF (localfilter == 1) THEN + ! Call generic OMI interface routine for domain-localized filters + CALL PDAFlocalomi_put_state(collect_state_pdaf, init_dim_obs_pdafomi, & obs_op_pdafomi, prepoststep_ens_offline, init_n_domains_pdaf, init_dim_l_pdaf, & - init_dim_obs_l_pdafomi, g2l_state_pdaf, l2g_state_pdaf, status_pdaf) + init_dim_obs_l_pdafomi, status_pdaf) ELSE IF (filtertype /= 8) THEN - ! All other filters can use one of the two generic OMI interface routines + ! Call generic OMI interface routine for global filters CALL PDAFomi_put_state_global(collect_state_pdaf, init_dim_obs_pdafomi, & obs_op_pdafomi, prepoststep_ens_offline, status_pdaf) ELSE - ! localized EnKF has its own OMI interface routine + ! LEnKF has its own OMI interface routine CALL PDAFomi_put_state_lenkf(collect_state_pdaf, init_dim_obs_pdafomi, & obs_op_pdafomi, prepoststep_ens_offline, localize_covar_pdafomi, status_pdaf) END IF diff --git a/tutorial/offline_2D_parallel/finalize_pdaf.F90 b/tutorial/offline_2D_parallel/finalize_pdaf.F90 index 6504f0685..5d55c75d9 100644 --- a/tutorial/offline_2D_parallel/finalize_pdaf.F90 +++ b/tutorial/offline_2D_parallel/finalize_pdaf.F90 @@ -19,7 +19,7 @@ SUBROUTINE finalize_pdaf() ! *** Show allocated memory for PDAF *** - CALL PDAF_print_info(11) + IF (mype_world==0) CALL PDAF_print_info(10) ! *** Print PDAF timings onto screen *** IF (mype_world==0) CALL PDAF_print_info(3) diff --git a/tutorial/offline_2D_parallel/g2l_state_pdaf.F90 b/tutorial/offline_2D_parallel/g2l_state_pdaf.F90 deleted file mode 100644 index 177740d1a..000000000 --- a/tutorial/offline_2D_parallel/g2l_state_pdaf.F90 +++ /dev/null @@ -1,49 +0,0 @@ -!> Restrict a model state to a local analysis domain -!! -!! User-supplied call-back routine for PDAF. -!! -!! Used in the filters: LSEIK/LETKF/LESTKF/LNETF -!! -!! The routine is called during the loop over all -!! local analysis domains in PDAF_X_update -!! before the analysis on a single local analysis -!! domain. It has to initialize elements of the -!! state vector for the local analysis domains from -!! the PE-local full state vector. -!! -!! Generic implementation using index vector -!! ID_LSTATE_IN_PSTATE. -!! -!! __Revision history:__ -!! * 2013-02 - Lars Nerger - Initial code -!! * Later revisions - see repository log -!! -SUBROUTINE g2l_state_pdaf(step, domain_p, dim_p, state_p, dim_l, state_l) - - USE mod_assimilation, & - ONLY: id_lstate_in_pstate - - IMPLICIT NONE - -! *** Arguments *** - INTEGER, INTENT(in) :: step !< Current time step - INTEGER, INTENT(in) :: domain_p !< Current local analysis domain - INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension - INTEGER, INTENT(in) :: dim_l !< Local state dimension - REAL, INTENT(in) :: state_p(dim_p) !< PE-local full state vector - REAL, INTENT(out) :: state_l(dim_l) !< State vector on local analysis domain - -! *** local variables *** - INTEGER :: i ! Counter - - -! ************************************* -! *** Initialize local state vector *** -! ************************************* - - ! Generic initialization using ID_LSTATE_IN_PSTATE set in INIT_DIM_L_PDAF - DO i = 1, dim_l - state_l(i) = state_p(id_lstate_in_pstate(i)) - END DO - -END SUBROUTINE g2l_state_pdaf diff --git a/tutorial/offline_2D_parallel/init_dim_l_pdaf.F90 b/tutorial/offline_2D_parallel/init_dim_l_pdaf.F90 index 8f0751381..2c36ac2df 100644 --- a/tutorial/offline_2D_parallel/init_dim_l_pdaf.F90 +++ b/tutorial/offline_2D_parallel/init_dim_l_pdaf.F90 @@ -16,8 +16,10 @@ !! SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) + USE PDAFlocal, & ! Routine to provide local indices to PDAF + ONLY: PDAFlocal_set_indices USE mod_assimilation, & ! Variables for assimilation - ONLY: coords_l, id_lstate_in_pstate, ny, local_dims + ONLY: coords_l, ny, local_dims USE mod_parallel_pdaf, & ! Parallelization ONLY: mype_filter @@ -31,6 +33,7 @@ SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) ! *** local variables *** INTEGER :: i ! Counters INTEGER :: off_p ! Process-local offset in global state vector + INTEGER, ALLOCATABLE :: id_lstate_in_pstate(:) ! Indices of local state vector in PE-local global state vector ! **************************************** @@ -61,10 +64,15 @@ SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) ! ****************************************************** ! Allocate array - IF (ALLOCATED(id_lstate_in_pstate)) DEALLOCATE(id_lstate_in_pstate) ALLOCATE(id_lstate_in_pstate(dim_l)) ! Here the local domain is a single grid point and variable given by DOMAIN_P id_lstate_in_pstate(1) = domain_p + ! Provide the index vector to PDAF + CALL PDAFlocal_set_indices(dim_l, id_lstate_in_pstate) + + ! Deallocate index array + DEALLOCATE(id_lstate_in_pstate) + END SUBROUTINE init_dim_l_pdaf diff --git a/tutorial/offline_2D_parallel/init_dim_obs_l_pdafomi_user.F90 b/tutorial/offline_2D_parallel/init_dim_obs_l_pdafomi_user.F90 new file mode 100644 index 000000000..b467d032d --- /dev/null +++ b/tutorial/offline_2D_parallel/init_dim_obs_l_pdafomi_user.F90 @@ -0,0 +1,110 @@ +!> Set dimension of local obs. vector and local obs. arrays +!! +!! This routine sets the number of local observations for the +!! current observation type for the local analysis domain +!! with coordinates COORD_l and a vector of localization cut-off +!! radii CRADIUS. +!! Further the routine initializes arrays for the index of a +!! local observation in the full observation vector and its +!! corresponding distance. +!! +!! This is a user-coded variant of PDAFomi_init_dim_obs_l +!! which yields better performance than the generic routine +!! provided by PDAF-OMI. This example uses an isotropic +!! localization with Cartesian distance calculation and +!! no periodicity of the model domain. +!! +!! __Revision history:__ +!! * 2024-09 - Lars Nerger - Initial code +!! * Later revisions - see repository log +!! +SUBROUTINE init_dim_obs_l_pdafomi_user(thisobs_l, thisobs, coords_l, locweight, cradius, & + sradius, cnt_obs_l_all) + + USE PDAFomi, & + ONLY: obs_f, obs_l, PDAFomi_set_dim_obs_l, PDAFomi_set_localization + + IMPLICIT NONE + +! *** Arguments *** + TYPE(obs_f), INTENT(inout) :: thisobs !< Data type with full observation + TYPE(obs_l), TARGET, INTENT(inout) :: thisobs_l !< Data type with local observation + REAL, INTENT(in) :: coords_l(thisobs%ncoord) !< Coordinates of current analysis domain + INTEGER, INTENT(in) :: locweight !< Type of localization function + REAL, INTENT(in) :: cradius !< Vector of localization cut-off radii + REAL, INTENT(in) :: sradius !< Vector of support radii of localization function + INTEGER, INTENT(inout) :: cnt_obs_l_all !< Local dimension of observation vector over all obs. types + +! *** Local variables *** + INTEGER :: i, cnt_l ! Counters + INTEGER :: cnt_obs ! Counted number of local observations + REAL :: distance2 ! squared distance + REAL :: dists(thisobs%ncoord) ! Distance vector between analysis point and observation + REAL :: crad2 ! square cut-off radius + + + doassim: IF (thisobs%doassim == 1) THEN + +! ************************************** +! *** Store localization information *** +! ************************************** + + CALL PDAFomi_set_localization(thisobs_l, cradius, sradius, locweight) + + +! ******************************** +! *** Count local observations *** +! ******************************** + + crad2 = thisobs_l%cradius(1) * thisobs_l%cradius(1) + + cnt_obs = 0 + countobs: DO i = 1, thisobs%dim_obs_f + + dists(1) = ABS(coords_l(1) - thisobs%ocoord_f(1, i)) + dists(2) = ABS(coords_l(2) - thisobs%ocoord_f(2, i)) + + distance2 = dists(1)*dists(1) + dists(2)*dists(2) + + ! Count observations within squared radius + IF (distance2 <= crad2) cnt_obs = cnt_obs + 1 + END DO countobs + + +! ************************************************ +! *** Initialize local observation for PDAFomi *** +! ************************************************ + + CALL PDAFomi_set_dim_obs_l(thisobs_l, thisobs, cnt_obs_l_all, cnt_obs) + + +! **************************************************************** +! *** Initialize local arrays in thisobs_l for local distances *** +! *** and indices of local obs. in full obs. vector *** +! **************************************************************** + + haveobs: IF (cnt_obs>0) THEN + + cnt_l = 0 + scanobs: DO i = 1, thisobs%dim_obs_f + + dists(1) = ABS(coords_l(1) - thisobs%ocoord_f(1, i)) + dists(2) = ABS(coords_l(2) - thisobs%ocoord_f(2, i)) + + distance2 = dists(1)*dists(1) + dists(2)*dists(2) + + IF (distance2 <= crad2) THEN + + cnt_l = cnt_l + 1 + + thisobs_l%id_obs_l(cnt_l) = i ! Index of local obs. in full obs. vector + thisobs_l%distance_l(cnt_l) = SQRT(distance2) ! distance + thisobs_l%cradius_l(cnt_l) = thisobs_l%cradius(1) ! cut-off radius + thisobs_l%sradius_l(cnt_l) = thisobs_l%sradius(1) ! support radius + END IF + END DO scanobs + END IF haveobs + + END IF doassim + +END SUBROUTINE init_dim_obs_l_pdafomi_user diff --git a/tutorial/offline_2D_parallel/l2g_state_pdaf.F90 b/tutorial/offline_2D_parallel/l2g_state_pdaf.F90 deleted file mode 100644 index 1a27e44f2..000000000 --- a/tutorial/offline_2D_parallel/l2g_state_pdaf.F90 +++ /dev/null @@ -1,50 +0,0 @@ -!> Initialize full state from local analysis -!! -!! User-supplied call-back routine for PDAF. -!! -!! Used in the filters: LSEIK/LETKF/LESTKF/LNETF -!! -!! The routine is called during the loop over all -!! local analysis domains in PDAF_X_update -!! after the analysis and ensemble transformation -!! on a single local analysis domain. It has to -!! initialize elements of the PE-local full state -!! vector from the provided analysis state vector -!! on the local analysis domain. -!! -!! Generic implementation using index vector -!! ID_LSTATE_IN_PSTATE. -!! -!! __Revision history:__ -!! * 2013-02 - Lars Nerger - Initial code -!! * Later revisions - see repository log -!! -SUBROUTINE l2g_state_pdaf(step, domain_p, dim_l, state_l, dim_p, state_p) - - USE mod_assimilation, & - ONLY: id_lstate_in_pstate - - IMPLICIT NONE - -! *** Arguments *** - INTEGER, INTENT(in) :: step !< Current time step - INTEGER, INTENT(in) :: domain_p !< Current local analysis domain - INTEGER, INTENT(in) :: dim_l !< Local state dimension - INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension - REAL, INTENT(in) :: state_l(dim_l) !< State vector on local analysis domain - REAL, INTENT(inout) :: state_p(dim_p) !< PE-local full state vector - -! *** local variables *** - INTEGER :: i ! Counter - - -! ************************************************** -! *** Initialize elements of global state vector *** -! ************************************************** - - ! Generic initialization using ID_LSTATE_IN_PSTATE set in INIT_DIM_L_PDAF - DO i = 1, dim_l - state_p(id_lstate_in_pstate(i)) = state_l(i) - END DO - -END SUBROUTINE l2g_state_pdaf diff --git a/tutorial/offline_2D_parallel/mod_assimilation.F90 b/tutorial/offline_2D_parallel/mod_assimilation.F90 index d0ffcf985..ba03ac05c 100644 --- a/tutorial/offline_2D_parallel/mod_assimilation.F90 +++ b/tutorial/offline_2D_parallel/mod_assimilation.F90 @@ -28,7 +28,6 @@ MODULE mod_assimilation ! *** Variables specific for model setup *** REAL :: coords_l(2) !< Coordinates of local analysis domain - INTEGER, ALLOCATABLE :: id_lstate_in_pstate(:) !< Indices of local state vector in PE-local global state vector ! Variables to handle multiple fields in the state vector INTEGER :: n_fields !< number of fields in state vector @@ -45,7 +44,7 @@ MODULE mod_assimilation ! Type variable holding field IDs in state vector TYPE(field_ids) :: id -!$OMP THREADPRIVATE(coords_l, id_lstate_in_pstate) +!$OMP THREADPRIVATE(coords_l) ! ----------------------------------------------------------------- @@ -70,18 +69,12 @@ MODULE mod_assimilation !< * (1) progress info !< * (2) add timings !< * (3) debugging output - INTEGER :: dim_ens !< Size of ensemble for SEIK/LSEIK/EnKF/ETKF \n - !< Number of EOFs to be used for SEEK + INTEGER :: dim_ens !< Size of ensemble INTEGER :: filtertype !< Select filter algorithm: !< * SEIK (1), EnKF (2), LSEIK (3), ETKF (4) !< LETKF (5), ESTKF (6), LESTKF (7), NETF (9), LNETF (10) !< LKNETF (11), PF (12), GENOBS (100), 3DVAR (200) INTEGER :: subtype !< Subtype of filter algorithm - !< * SEEK: - !< (0) evolve normalized modes - !< (1) evolve scaled modes with unit U - !< (2) fixed basis (V); variable U matrix - !< (3) fixed covar matrix (V,U kept static) !< * SEIK: !< (0) ensemble forecast; new formulation !< (1) ensemble forecast; old formulation diff --git a/tutorial/offline_2D_parallel/parser_mpi.F90 b/tutorial/offline_2D_parallel/parser_mpi.F90 index 4269eed43..40258b6ac 100644 --- a/tutorial/offline_2D_parallel/parser_mpi.F90 +++ b/tutorial/offline_2D_parallel/parser_mpi.F90 @@ -47,12 +47,14 @@ !! to be specified as 'T' or 'F'. !! !! __Revision history:__ -!! * 2019-06 - Stephan Frickenhaus, Lars Nerger - Initial code +!! * 2003-02 - Stephan Frickenhaus, Lars Nerger - Initial code !! * Later revisions - see repository log !! MODULE parser use mpi + USE mod_parallel_pdaf, & + ONLY: abort_parallel IMPLICIT NONE SAVE @@ -187,6 +189,8 @@ SUBROUTINE parse_string(handle, charvalue) ! *** local variables *** CHARACTER(len=100) :: string CHARACTER(len=100) :: parsed_string + CHARACTER(len=110) :: str1_check + CHARACTER(len=110) :: str2_check LOGICAL :: modified ! *** Initialize *** @@ -206,9 +210,27 @@ SUBROUTINE parse_string(handle, charvalue) DO i = 1, command_argument_count() - 1 CALL get_command_argument(i, str1) CALL get_command_argument(i+1, str2) + + ! Add check for inadmissible strings longer than 100 + ! characters + CALL get_command_argument(i, str1_check) + CALL get_command_argument(i+1, str2_check) + IF (mype == 0) THEN + IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN + WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long." + WRITE (*,'(2x, a, 1x, a)') "called handle=", TRIM(string) + WRITE (*,'(2x, a, 1x, a)') "parsed handle=", TRIM(str1) + WRITE (*,'(2x, a, 1x, a)') "parsed input(cut)=", TRIM(str2) + call abort_parallel() + END IF + END IF + + #endif IF (str1 == TRIM(string)) THEN - READ(str2, *) parsed_string + ! Format specifier is needed for reading paths. Using + ! `*` as format specifier, reading stops at a `/` + READ(str2, '(a)') parsed_string modified = .TRUE. END IF ENDDO diff --git a/tutorial/offline_2D_serial/Makefile b/tutorial/offline_2D_serial/Makefile index 3653b60f7..c86ca20ff 100644 --- a/tutorial/offline_2D_serial/Makefile +++ b/tutorial/offline_2D_serial/Makefile @@ -66,9 +66,7 @@ OBJ_USER_GEN = init_ens_offline.o \ # User-supplied routines for localized analysis OBJ_USER_LOCAL = init_n_domains_pdaf.o \ - init_dim_l_pdaf.o \ - g2l_state_pdaf.o \ - l2g_state_pdaf.o + init_dim_l_pdaf.o # Full list of user-supplied routines for online modes OBJ_PDAF_USER = $(OBJ_USER_PDAFOMI) $(OBJ_USER_GEN) $(OBJ_USER_LOCAL) @@ -87,7 +85,7 @@ $(EXE) : libpdaf-d.a \ libpdaf-d.a: @echo "++++++ Generate Filter library ++++++" - @cd $(BASEDIR)/src; make; + @cd $(BASEDIR); make; ###################################################### @@ -111,7 +109,7 @@ clean : cleanpdaf: @echo "+++ Clean up PDAF directory" - cd $(BASEDIR)/src; make clean + cd $(BASEDIR); make clean cleandata: rm -f ens*ana.txt state_ana.txt diff --git a/tutorial/offline_2D_serial/assimilate_pdaf_offline.F90 b/tutorial/offline_2D_serial/assimilate_pdaf_offline.F90 index b8c22927f..a75f7687f 100644 --- a/tutorial/offline_2D_serial/assimilate_pdaf_offline.F90 +++ b/tutorial/offline_2D_serial/assimilate_pdaf_offline.F90 @@ -15,8 +15,10 @@ SUBROUTINE assimilate_pdaf_offline() USE PDAF_interfaces_module, & ! Interface definitions to PDAF core routines - ONLY: PDAFomi_assimilate_local, PDAFomi_assimilate_global, & - PDAFomi_assimilate_lenkf, PDAF_get_localfilter + ONLY: PDAFomi_put_state_global, & + PDAFomi_put_state_lenkf, PDAF_get_localfilter + USE PDAFlocal, & ! Interface definitions for PDAFlocal + ONLY: PDAFlocalomi_put_state USE mod_parallel_pdaf, & ! Parallelization ONLY: mype_world, abort_parallel USE mod_assimilation, & ! Variables for assimilation @@ -43,9 +45,7 @@ SUBROUTINE assimilate_pdaf_offline() prepoststep_ens_offline ! User supplied pre/poststep routine ! Localization of state vector EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains - init_dim_l_pdaf, & ! Initialize state dimension for local analysis domain - g2l_state_pdaf, & ! Get state on local analysis domain from global state - l2g_state_pdaf ! Update global state from state on local analysis domain + init_dim_l_pdaf ! Initialize state dimension for local analysis domain ! Interface to PDAF-OMI for local and global filters EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain @@ -71,18 +71,18 @@ SUBROUTINE assimilate_pdaf_offline() ! Call assimilate routine for global or local filter IF (localfilter == 1) THEN ! Call generic OMI interface routine for domain-localized filters - CALL PDAFomi_put_state_local(collect_state_pdaf, init_dim_obs_pdafomi, & + CALL PDAFlocalomi_put_state(collect_state_pdaf, init_dim_obs_pdafomi, & obs_op_pdafomi, prepoststep_ens_offline, init_n_domains_pdaf, init_dim_l_pdaf, & - init_dim_obs_l_pdafomi, g2l_state_pdaf, l2g_state_pdaf, status_pdaf) + init_dim_obs_l_pdafomi, status_pdaf) ELSE - IF (filtertype == 8) THEN - ! LEnKF has its own OMI interface routine - CALL PDAFomi_put_state_lenkf(collect_state_pdaf, init_dim_obs_pdafomi, & - obs_op_pdafomi, prepoststep_ens_offline, localize_covar_pdafomi, status_pdaf) - ELSE + IF (filtertype /= 8) THEN ! Call generic OMI interface routine for global filters CALL PDAFomi_put_state_global(collect_state_pdaf, init_dim_obs_pdafomi, & obs_op_pdafomi, prepoststep_ens_offline, status_pdaf) + ELSE + ! LEnKF has its own OMI interface routine + CALL PDAFomi_put_state_lenkf(collect_state_pdaf, init_dim_obs_pdafomi, & + obs_op_pdafomi, prepoststep_ens_offline, localize_covar_pdafomi, status_pdaf) END IF END IF diff --git a/tutorial/offline_2D_serial/g2l_state_pdaf.F90 b/tutorial/offline_2D_serial/g2l_state_pdaf.F90 deleted file mode 100644 index 177740d1a..000000000 --- a/tutorial/offline_2D_serial/g2l_state_pdaf.F90 +++ /dev/null @@ -1,49 +0,0 @@ -!> Restrict a model state to a local analysis domain -!! -!! User-supplied call-back routine for PDAF. -!! -!! Used in the filters: LSEIK/LETKF/LESTKF/LNETF -!! -!! The routine is called during the loop over all -!! local analysis domains in PDAF_X_update -!! before the analysis on a single local analysis -!! domain. It has to initialize elements of the -!! state vector for the local analysis domains from -!! the PE-local full state vector. -!! -!! Generic implementation using index vector -!! ID_LSTATE_IN_PSTATE. -!! -!! __Revision history:__ -!! * 2013-02 - Lars Nerger - Initial code -!! * Later revisions - see repository log -!! -SUBROUTINE g2l_state_pdaf(step, domain_p, dim_p, state_p, dim_l, state_l) - - USE mod_assimilation, & - ONLY: id_lstate_in_pstate - - IMPLICIT NONE - -! *** Arguments *** - INTEGER, INTENT(in) :: step !< Current time step - INTEGER, INTENT(in) :: domain_p !< Current local analysis domain - INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension - INTEGER, INTENT(in) :: dim_l !< Local state dimension - REAL, INTENT(in) :: state_p(dim_p) !< PE-local full state vector - REAL, INTENT(out) :: state_l(dim_l) !< State vector on local analysis domain - -! *** local variables *** - INTEGER :: i ! Counter - - -! ************************************* -! *** Initialize local state vector *** -! ************************************* - - ! Generic initialization using ID_LSTATE_IN_PSTATE set in INIT_DIM_L_PDAF - DO i = 1, dim_l - state_l(i) = state_p(id_lstate_in_pstate(i)) - END DO - -END SUBROUTINE g2l_state_pdaf diff --git a/tutorial/offline_2D_serial/init_dim_l_pdaf.F90 b/tutorial/offline_2D_serial/init_dim_l_pdaf.F90 index 7ce79b7b8..f682e0cf4 100644 --- a/tutorial/offline_2D_serial/init_dim_l_pdaf.F90 +++ b/tutorial/offline_2D_serial/init_dim_l_pdaf.F90 @@ -16,8 +16,10 @@ !! SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) + USE PDAFlocal, & ! Routine to provide local indices to PDAF + ONLY: PDAFlocal_set_indices USE mod_assimilation, & ! Variables for assimilation - ONLY: coords_l, id_lstate_in_pstate, ny + ONLY: coords_l, ny IMPLICIT NONE @@ -26,6 +28,9 @@ SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) INTEGER, INTENT(in) :: domain_p !< Current local analysis domain INTEGER, INTENT(out) :: dim_l !< Local state dimension +! *** local variables *** + INTEGER, ALLOCATABLE :: id_lstate_in_pstate(:) !< Indices of local state vector in PE-local global state vector + ! **************************************** ! *** Initialize local state dimension *** @@ -49,10 +54,15 @@ SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) ! ****************************************************** ! Allocate array - IF (ALLOCATED(id_lstate_in_pstate)) DEALLOCATE(id_lstate_in_pstate) ALLOCATE(id_lstate_in_pstate(dim_l)) ! Here the local domain is a single grid point and variable given by DOMAIN_P id_lstate_in_pstate(1) = domain_p + ! Provide the index vector to PDAF + CALL PDAFlocal_set_indices(dim_l, id_lstate_in_pstate) + + ! Deallocate index array + DEALLOCATE(id_lstate_in_pstate) + END SUBROUTINE init_dim_l_pdaf diff --git a/tutorial/offline_2D_serial/l2g_state_pdaf.F90 b/tutorial/offline_2D_serial/l2g_state_pdaf.F90 deleted file mode 100644 index 1a27e44f2..000000000 --- a/tutorial/offline_2D_serial/l2g_state_pdaf.F90 +++ /dev/null @@ -1,50 +0,0 @@ -!> Initialize full state from local analysis -!! -!! User-supplied call-back routine for PDAF. -!! -!! Used in the filters: LSEIK/LETKF/LESTKF/LNETF -!! -!! The routine is called during the loop over all -!! local analysis domains in PDAF_X_update -!! after the analysis and ensemble transformation -!! on a single local analysis domain. It has to -!! initialize elements of the PE-local full state -!! vector from the provided analysis state vector -!! on the local analysis domain. -!! -!! Generic implementation using index vector -!! ID_LSTATE_IN_PSTATE. -!! -!! __Revision history:__ -!! * 2013-02 - Lars Nerger - Initial code -!! * Later revisions - see repository log -!! -SUBROUTINE l2g_state_pdaf(step, domain_p, dim_l, state_l, dim_p, state_p) - - USE mod_assimilation, & - ONLY: id_lstate_in_pstate - - IMPLICIT NONE - -! *** Arguments *** - INTEGER, INTENT(in) :: step !< Current time step - INTEGER, INTENT(in) :: domain_p !< Current local analysis domain - INTEGER, INTENT(in) :: dim_l !< Local state dimension - INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension - REAL, INTENT(in) :: state_l(dim_l) !< State vector on local analysis domain - REAL, INTENT(inout) :: state_p(dim_p) !< PE-local full state vector - -! *** local variables *** - INTEGER :: i ! Counter - - -! ************************************************** -! *** Initialize elements of global state vector *** -! ************************************************** - - ! Generic initialization using ID_LSTATE_IN_PSTATE set in INIT_DIM_L_PDAF - DO i = 1, dim_l - state_p(id_lstate_in_pstate(i)) = state_l(i) - END DO - -END SUBROUTINE l2g_state_pdaf diff --git a/tutorial/offline_2D_serial/mod_assimilation.F90 b/tutorial/offline_2D_serial/mod_assimilation.F90 index 2a450f15d..085aa5fae 100644 --- a/tutorial/offline_2D_serial/mod_assimilation.F90 +++ b/tutorial/offline_2D_serial/mod_assimilation.F90 @@ -8,6 +8,9 @@ !! Most variables can be specified as a command line !! argument. !! +!! Implementation for the 2D offline example +!! with or without parallelization. +!! !! __Revision history:__ !! * 2013-02 - Lars Nerger - Initial code !! * Later revisions - see repository log @@ -25,9 +28,9 @@ MODULE mod_assimilation ! *** Variables specific for model setup *** REAL :: coords_l(2) !< Coordinates of local analysis domain - INTEGER, ALLOCATABLE :: id_lstate_in_pstate(:) !< Indices of local state vector in PE-local global state vector - ! Variables to handle multiple fields in the state vector +! *** Variables to handle multiple fields in the state vector *** + INTEGER :: n_fields !< number of fields in state vector INTEGER, ALLOCATABLE :: off_fields(:) !< Offsets of fields in state vector INTEGER, ALLOCATABLE :: dim_fields(:) !< Dimension of fields in state vector @@ -42,7 +45,7 @@ MODULE mod_assimilation ! Type variable holding field IDs in state vector TYPE(field_ids) :: id -!$OMP THREADPRIVATE(coords_l, id_lstate_in_pstate) +!$OMP THREADPRIVATE(coords_l) ! ----------------------------------------------------------------- @@ -67,18 +70,12 @@ MODULE mod_assimilation !< * (1) progress info !< * (2) add timings !< * (3) debugging output - INTEGER :: dim_ens !< Size of ensemble for SEIK/LSEIK/EnKF/ETKF \n - !< Number of EOFs to be used for SEEK + INTEGER :: dim_ens !< Size of ensemble INTEGER :: filtertype !< Select filter algorithm: - !< * SEEK (0), SEIK (1), EnKF (2), LSEIK (3), ETKF (4) + !< * SEIK (1), EnKF (2), LSEIK (3), ETKF (4) !< LETKF (5), ESTKF (6), LESTKF (7), NETF (9), LNETF (10) !< LKNETF (11), PF (12), GENOBS (100), 3DVAR (200) INTEGER :: subtype !< Subtype of filter algorithm - !< * SEEK: - !< (0) evolve normalized modes - !< (1) evolve scaled modes with unit U - !< (2) fixed basis (V); variable U matrix - !< (3) fixed covar matrix (V,U kept static) !< * SEIK: !< (0) ensemble forecast; new formulation !< (1) ensemble forecast; old formulation @@ -152,9 +149,6 @@ MODULE mod_assimilation !< (4) regulated localization of R with single-point error variance REAL :: sradius !< Support radius for 5th order polynomial !< or radius for 1/e for exponential weighting -! ! SEEK - INTEGER :: int_rediag !< Interval to perform re-diagonalization in SEEK - REAL :: epsilon !< Epsilon for gradient approx. in SEEK forecast ! ! ENKF INTEGER :: rank_ana_enkf !< Rank to be considered for inversion of HPH in analysis of EnKF !< (0) for analysis w/o eigendecomposition diff --git a/tutorial/offline_2D_serial/parser_mpi.F90 b/tutorial/offline_2D_serial/parser_mpi.F90 index 4269eed43..40258b6ac 100644 --- a/tutorial/offline_2D_serial/parser_mpi.F90 +++ b/tutorial/offline_2D_serial/parser_mpi.F90 @@ -47,12 +47,14 @@ !! to be specified as 'T' or 'F'. !! !! __Revision history:__ -!! * 2019-06 - Stephan Frickenhaus, Lars Nerger - Initial code +!! * 2003-02 - Stephan Frickenhaus, Lars Nerger - Initial code !! * Later revisions - see repository log !! MODULE parser use mpi + USE mod_parallel_pdaf, & + ONLY: abort_parallel IMPLICIT NONE SAVE @@ -187,6 +189,8 @@ SUBROUTINE parse_string(handle, charvalue) ! *** local variables *** CHARACTER(len=100) :: string CHARACTER(len=100) :: parsed_string + CHARACTER(len=110) :: str1_check + CHARACTER(len=110) :: str2_check LOGICAL :: modified ! *** Initialize *** @@ -206,9 +210,27 @@ SUBROUTINE parse_string(handle, charvalue) DO i = 1, command_argument_count() - 1 CALL get_command_argument(i, str1) CALL get_command_argument(i+1, str2) + + ! Add check for inadmissible strings longer than 100 + ! characters + CALL get_command_argument(i, str1_check) + CALL get_command_argument(i+1, str2_check) + IF (mype == 0) THEN + IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN + WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long." + WRITE (*,'(2x, a, 1x, a)') "called handle=", TRIM(string) + WRITE (*,'(2x, a, 1x, a)') "parsed handle=", TRIM(str1) + WRITE (*,'(2x, a, 1x, a)') "parsed input(cut)=", TRIM(str2) + call abort_parallel() + END IF + END IF + + #endif IF (str1 == TRIM(string)) THEN - READ(str2, *) parsed_string + ! Format specifier is needed for reading paths. Using + ! `*` as format specifier, reading stops at a `/` + READ(str2, '(a)') parsed_string modified = .TRUE. END IF ENDDO diff --git a/tutorial/online_2D_parallelmodel/Makefile b/tutorial/online_2D_parallelmodel/Makefile index 1c9527873..311294708 100644 --- a/tutorial/online_2D_parallelmodel/Makefile +++ b/tutorial/online_2D_parallelmodel/Makefile @@ -69,9 +69,7 @@ OBJ_USER_GEN = init_ens_pdaf.o \ # User-supplied routines for localized analysis (LESTKF/LSEIK/LETKF) OBJ_USER_LOCAL = init_n_domains_pdaf.o \ - init_dim_l_pdaf.o \ - g2l_state_pdaf.o \ - l2g_state_pdaf.o + init_dim_l_pdaf.o # Full list of user-supplied routines for online modes OBJ_PDAF_USER = $(OBJ_USER_PDAFOMI) $(OBJ_PDAF_INT) $(OBJ_USER_GEN) $(OBJ_USER_LOCAL) @@ -108,7 +106,7 @@ model_pdaf : libpdaf-d.a \ libpdaf-d.a: @echo "++++++ Generate Filter library ++++++" - @cd $(BASEDIR)/src; make; + @cd $(BASEDIR); make; ###################################################### @@ -133,7 +131,7 @@ clean : cleanpdaf: @echo "+++ Clean up PDAF directory" - cd $(BASEDIR)/src; make clean + cd $(BASEDIR); make clean cleandata: rm -f ens*ana.txt ens*for.txt state_*ana.txt state_*for.txt diff --git a/tutorial/online_2D_parallelmodel/assimilate_pdaf.F90 b/tutorial/online_2D_parallelmodel/assimilate_pdaf.F90 index 53ac9324c..ab3397b58 100644 --- a/tutorial/online_2D_parallelmodel/assimilate_pdaf.F90 +++ b/tutorial/online_2D_parallelmodel/assimilate_pdaf.F90 @@ -11,9 +11,11 @@ !! SUBROUTINE assimilate_pdaf() - USE pdaf_interfaces_module, & ! Interface definitions to PDAF core routines + USE PDAF_interfaces_module, & ! Interface definitions to PDAF core routines ONLY: PDAFomi_assimilate_local, PDAFomi_assimilate_global, & PDAFomi_assimilate_lenkf, PDAF_get_localfilter + USE PDAFlocal, & ! Interface definitions for PDAFlocal + ONLY: PDAFlocalomi_put_state USE mod_parallel_model, & ! Parallelization ONLY: mype_world, abort_parallel USE mod_assimilation, & ! Variables for assimilation @@ -40,9 +42,7 @@ SUBROUTINE assimilate_pdaf() prepoststep_pdaf ! User supplied pre/poststep routine ! Localization of state vector EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains - init_dim_l_pdaf, & ! Initialize state dimension for local analysis domain - g2l_state_pdaf, & ! Get state on local analysis domain from global state - l2g_state_pdaf ! Update global state from state on local analysis domain + init_dim_l_pdaf ! Initialize state dimension for local analysis domain ! Interface to PDAF-OMI for local and global filters EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain @@ -60,10 +60,9 @@ SUBROUTINE assimilate_pdaf() ! Call assimilate routine for global or local filter IF (localfilter == 1) THEN ! Call generic OMI interface routine for domain-localized filters - CALL PDAFomi_assimilate_local(collect_state_pdaf, distribute_state_pdaf, & + CALL PDAFlocalomi_assimilate(collect_state_pdaf, distribute_state_pdaf, & init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & - init_dim_l_pdaf, init_dim_obs_l_pdafomi, g2l_state_pdaf, l2g_state_pdaf, & - next_observation_pdaf, status_pdaf) + init_dim_l_pdaf, init_dim_obs_l_pdafomi, next_observation_pdaf, status_pdaf) ELSE IF (filtertype == 8) THEN ! LEnKF has its own OMI interface routine diff --git a/tutorial/online_2D_parallelmodel/g2l_state_pdaf.F90 b/tutorial/online_2D_parallelmodel/g2l_state_pdaf.F90 deleted file mode 100644 index 177740d1a..000000000 --- a/tutorial/online_2D_parallelmodel/g2l_state_pdaf.F90 +++ /dev/null @@ -1,49 +0,0 @@ -!> Restrict a model state to a local analysis domain -!! -!! User-supplied call-back routine for PDAF. -!! -!! Used in the filters: LSEIK/LETKF/LESTKF/LNETF -!! -!! The routine is called during the loop over all -!! local analysis domains in PDAF_X_update -!! before the analysis on a single local analysis -!! domain. It has to initialize elements of the -!! state vector for the local analysis domains from -!! the PE-local full state vector. -!! -!! Generic implementation using index vector -!! ID_LSTATE_IN_PSTATE. -!! -!! __Revision history:__ -!! * 2013-02 - Lars Nerger - Initial code -!! * Later revisions - see repository log -!! -SUBROUTINE g2l_state_pdaf(step, domain_p, dim_p, state_p, dim_l, state_l) - - USE mod_assimilation, & - ONLY: id_lstate_in_pstate - - IMPLICIT NONE - -! *** Arguments *** - INTEGER, INTENT(in) :: step !< Current time step - INTEGER, INTENT(in) :: domain_p !< Current local analysis domain - INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension - INTEGER, INTENT(in) :: dim_l !< Local state dimension - REAL, INTENT(in) :: state_p(dim_p) !< PE-local full state vector - REAL, INTENT(out) :: state_l(dim_l) !< State vector on local analysis domain - -! *** local variables *** - INTEGER :: i ! Counter - - -! ************************************* -! *** Initialize local state vector *** -! ************************************* - - ! Generic initialization using ID_LSTATE_IN_PSTATE set in INIT_DIM_L_PDAF - DO i = 1, dim_l - state_l(i) = state_p(id_lstate_in_pstate(i)) - END DO - -END SUBROUTINE g2l_state_pdaf diff --git a/tutorial/online_2D_parallelmodel/init_dim_l_pdaf.F90 b/tutorial/online_2D_parallelmodel/init_dim_l_pdaf.F90 index c9425efb5..70aea27f7 100644 --- a/tutorial/online_2D_parallelmodel/init_dim_l_pdaf.F90 +++ b/tutorial/online_2D_parallelmodel/init_dim_l_pdaf.F90 @@ -16,10 +16,12 @@ !! SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) + USE PDAFlocal, & ! Routine to provide local indices to PDAF + ONLY: PDAFlocal_set_indices USE mod_model, & ! Model variables ONLY: ny, nx_p USE mod_assimilation, & ! Variables for assimilation - ONLY: coords_l, id_lstate_in_pstate + ONLY: coords_l USE mod_parallel_pdaf, & ! assimilation parallelization variables ONLY: mype_filter @@ -33,6 +35,7 @@ SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) ! *** local variables *** INTEGER :: i ! Counters INTEGER :: off_p ! Process-local offset in global state vector + INTEGER, ALLOCATABLE :: id_lstate_in_pstate(:) !< Indices of local state vector in PE-local global state vector ! **************************************** @@ -62,10 +65,15 @@ SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) ! ****************************************************** ! Allocate array - IF (ALLOCATED(id_lstate_in_pstate)) DEALLOCATE(id_lstate_in_pstate) ALLOCATE(id_lstate_in_pstate(dim_l)) ! Here the local domain is a single grid point and variable given by DOMAIN_P id_lstate_in_pstate(1) = domain_p + ! Provide the index vector to PDAF + CALL PDAFlocal_set_indices(dim_l, id_lstate_in_pstate) + + ! Deallocate index array + DEALLOCATE(id_lstate_in_pstate) + END SUBROUTINE init_dim_l_pdaf diff --git a/tutorial/online_2D_parallelmodel/l2g_state_pdaf.F90 b/tutorial/online_2D_parallelmodel/l2g_state_pdaf.F90 deleted file mode 100644 index 1a27e44f2..000000000 --- a/tutorial/online_2D_parallelmodel/l2g_state_pdaf.F90 +++ /dev/null @@ -1,50 +0,0 @@ -!> Initialize full state from local analysis -!! -!! User-supplied call-back routine for PDAF. -!! -!! Used in the filters: LSEIK/LETKF/LESTKF/LNETF -!! -!! The routine is called during the loop over all -!! local analysis domains in PDAF_X_update -!! after the analysis and ensemble transformation -!! on a single local analysis domain. It has to -!! initialize elements of the PE-local full state -!! vector from the provided analysis state vector -!! on the local analysis domain. -!! -!! Generic implementation using index vector -!! ID_LSTATE_IN_PSTATE. -!! -!! __Revision history:__ -!! * 2013-02 - Lars Nerger - Initial code -!! * Later revisions - see repository log -!! -SUBROUTINE l2g_state_pdaf(step, domain_p, dim_l, state_l, dim_p, state_p) - - USE mod_assimilation, & - ONLY: id_lstate_in_pstate - - IMPLICIT NONE - -! *** Arguments *** - INTEGER, INTENT(in) :: step !< Current time step - INTEGER, INTENT(in) :: domain_p !< Current local analysis domain - INTEGER, INTENT(in) :: dim_l !< Local state dimension - INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension - REAL, INTENT(in) :: state_l(dim_l) !< State vector on local analysis domain - REAL, INTENT(inout) :: state_p(dim_p) !< PE-local full state vector - -! *** local variables *** - INTEGER :: i ! Counter - - -! ************************************************** -! *** Initialize elements of global state vector *** -! ************************************************** - - ! Generic initialization using ID_LSTATE_IN_PSTATE set in INIT_DIM_L_PDAF - DO i = 1, dim_l - state_p(id_lstate_in_pstate(i)) = state_l(i) - END DO - -END SUBROUTINE l2g_state_pdaf diff --git a/tutorial/online_2D_parallelmodel/mod_assimilation.F90 b/tutorial/online_2D_parallelmodel/mod_assimilation.F90 index 62cc896c0..9200a923b 100644 --- a/tutorial/online_2D_parallelmodel/mod_assimilation.F90 +++ b/tutorial/online_2D_parallelmodel/mod_assimilation.F90 @@ -20,7 +20,6 @@ MODULE mod_assimilation IMPLICIT NONE SAVE - ! *** Variables specific for online tutorial example *** INTEGER :: ensgroup=1 !< Type of initial ensemble @@ -28,9 +27,9 @@ MODULE mod_assimilation ! *** Variables specific for model setup *** REAL :: coords_l(2) !< Coordinates of local analysis domain - INTEGER, ALLOCATABLE :: id_lstate_in_pstate(:) !< Indices of local state vector in PE-local global state vector - ! Variables to handle multiple fields in the state vector +! *** Variables to handle multiple fields in the state vector *** + INTEGER :: n_fields !< number of fields in state vector INTEGER, ALLOCATABLE :: off_fields(:) !< Offsets of fields in state vector INTEGER, ALLOCATABLE :: dim_fields(:) !< Dimension of fields in state vector @@ -45,7 +44,7 @@ MODULE mod_assimilation ! Type variable holding field IDs in state vector TYPE(field_ids) :: id -!$OMP THREADPRIVATE(coords_l, id_lstate_in_pstate) +!$OMP THREADPRIVATE(coords_l) ! ----------------------------------------------------------------- @@ -70,18 +69,12 @@ MODULE mod_assimilation !< * (1) progress info !< * (2) add timings !< * (3) debugging output - INTEGER :: dim_ens !< Size of ensemble for SEIK/LSEIK/EnKF/ETKF \n - !< Number of EOFs to be used for SEEK + INTEGER :: dim_ens !< Size of ensemble INTEGER :: filtertype !< Select filter algorithm: - !< * SEEK (0), SEIK (1), EnKF (2), LSEIK (3), ETKF (4) + !< * SEIK (1), EnKF (2), LSEIK (3), ETKF (4) !< LETKF (5), ESTKF (6), LESTKF (7), NETF (9), LNETF (10) !< LKNETF (11), PF (12), GENOBS (100), 3DVAR (200) INTEGER :: subtype !< Subtype of filter algorithm - !< * SEEK: - !< (0) evolve normalized modes - !< (1) evolve scaled modes with unit U - !< (2) fixed basis (V); variable U matrix - !< (3) fixed covar matrix (V,U kept static) !< * SEIK: !< (0) ensemble forecast; new formulation !< (1) ensemble forecast; old formulation @@ -155,9 +148,6 @@ MODULE mod_assimilation !< (4) regulated localization of R with single-point error variance REAL :: sradius !< Support radius for 5th order polynomial !< or radius for 1/e for exponential weighting -! ! SEEK - INTEGER :: int_rediag !< Interval to perform re-diagonalization in SEEK - REAL :: epsilon !< Epsilon for gradient approx. in SEEK forecast ! ! ENKF INTEGER :: rank_ana_enkf !< Rank to be considered for inversion of HPH in analysis of EnKF !< (0) for analysis w/o eigendecomposition diff --git a/tutorial/online_2D_parallelmodel/parser_mpi.F90 b/tutorial/online_2D_parallelmodel/parser_mpi.F90 index 4269eed43..6ddcbb65d 100644 --- a/tutorial/online_2D_parallelmodel/parser_mpi.F90 +++ b/tutorial/online_2D_parallelmodel/parser_mpi.F90 @@ -47,12 +47,14 @@ !! to be specified as 'T' or 'F'. !! !! __Revision history:__ -!! * 2019-06 - Stephan Frickenhaus, Lars Nerger - Initial code +!! * 2003-02 - Stephan Frickenhaus, Lars Nerger - Initial code !! * Later revisions - see repository log !! MODULE parser use mpi + USE mod_parallel_model, & + ONLY: abort_parallel IMPLICIT NONE SAVE @@ -187,6 +189,8 @@ SUBROUTINE parse_string(handle, charvalue) ! *** local variables *** CHARACTER(len=100) :: string CHARACTER(len=100) :: parsed_string + CHARACTER(len=110) :: str1_check + CHARACTER(len=110) :: str2_check LOGICAL :: modified ! *** Initialize *** @@ -206,9 +210,27 @@ SUBROUTINE parse_string(handle, charvalue) DO i = 1, command_argument_count() - 1 CALL get_command_argument(i, str1) CALL get_command_argument(i+1, str2) + + ! Add check for inadmissible strings longer than 100 + ! characters + CALL get_command_argument(i, str1_check) + CALL get_command_argument(i+1, str2_check) + IF (mype == 0) THEN + IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN + WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long." + WRITE (*,'(2x, a, 1x, a)') "called handle=", TRIM(string) + WRITE (*,'(2x, a, 1x, a)') "parsed handle=", TRIM(str1) + WRITE (*,'(2x, a, 1x, a)') "parsed input(cut)=", TRIM(str2) + call abort_parallel() + END IF + END IF + + #endif IF (str1 == TRIM(string)) THEN - READ(str2, *) parsed_string + ! Format specifier is needed for reading paths. Using + ! `*` as format specifier, reading stops at a `/` + READ(str2, '(a)') parsed_string modified = .TRUE. END IF ENDDO diff --git a/tutorial/online_2D_parallelmodel_fullpar/Makefile b/tutorial/online_2D_parallelmodel_fullpar/Makefile index 90200607e..5a8e91cea 100644 --- a/tutorial/online_2D_parallelmodel_fullpar/Makefile +++ b/tutorial/online_2D_parallelmodel_fullpar/Makefile @@ -70,9 +70,7 @@ OBJ_USER_GEN = init_ens_pdaf.o \ # User-supplied routines for localized analysis (LESTKF/LSEIK/LETKF) OBJ_USER_LOCAL = init_n_domains_pdaf.o \ - init_dim_l_pdaf.o \ - g2l_state_pdaf.o \ - l2g_state_pdaf.o + init_dim_l_pdaf.o # Full list of user-supplied routines for online modes OBJ_PDAF_USER = $(OBJ_USER_PDAFOMI) $(OBJ_PDAF_INT) $(OBJ_USER_GEN) $(OBJ_USER_LOCAL) @@ -108,7 +106,7 @@ model_pdaf : libpdaf-d.a \ libpdaf-d.a: @echo "++++++ Generate Filter library ++++++" - @cd $(BASEDIR)/src; make; + @cd $(BASEDIR); make; ###################################################### @@ -131,7 +129,7 @@ clean : cleanpdaf: @echo "+++ Clean up PDAF directory" - cd $(BASEDIR)/src; make clean + cd $(BASEDIR); make clean cleandata: rm -f ens*ana.txt ens*for.txt state_*ana.txt state_*for.txt diff --git a/tutorial/online_2D_parallelmodel_fullpar/assimilate_pdaf.F90 b/tutorial/online_2D_parallelmodel_fullpar/assimilate_pdaf.F90 index 53ac9324c..ab3397b58 100644 --- a/tutorial/online_2D_parallelmodel_fullpar/assimilate_pdaf.F90 +++ b/tutorial/online_2D_parallelmodel_fullpar/assimilate_pdaf.F90 @@ -11,9 +11,11 @@ !! SUBROUTINE assimilate_pdaf() - USE pdaf_interfaces_module, & ! Interface definitions to PDAF core routines + USE PDAF_interfaces_module, & ! Interface definitions to PDAF core routines ONLY: PDAFomi_assimilate_local, PDAFomi_assimilate_global, & PDAFomi_assimilate_lenkf, PDAF_get_localfilter + USE PDAFlocal, & ! Interface definitions for PDAFlocal + ONLY: PDAFlocalomi_put_state USE mod_parallel_model, & ! Parallelization ONLY: mype_world, abort_parallel USE mod_assimilation, & ! Variables for assimilation @@ -40,9 +42,7 @@ SUBROUTINE assimilate_pdaf() prepoststep_pdaf ! User supplied pre/poststep routine ! Localization of state vector EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains - init_dim_l_pdaf, & ! Initialize state dimension for local analysis domain - g2l_state_pdaf, & ! Get state on local analysis domain from global state - l2g_state_pdaf ! Update global state from state on local analysis domain + init_dim_l_pdaf ! Initialize state dimension for local analysis domain ! Interface to PDAF-OMI for local and global filters EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain @@ -60,10 +60,9 @@ SUBROUTINE assimilate_pdaf() ! Call assimilate routine for global or local filter IF (localfilter == 1) THEN ! Call generic OMI interface routine for domain-localized filters - CALL PDAFomi_assimilate_local(collect_state_pdaf, distribute_state_pdaf, & + CALL PDAFlocalomi_assimilate(collect_state_pdaf, distribute_state_pdaf, & init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & - init_dim_l_pdaf, init_dim_obs_l_pdafomi, g2l_state_pdaf, l2g_state_pdaf, & - next_observation_pdaf, status_pdaf) + init_dim_l_pdaf, init_dim_obs_l_pdafomi, next_observation_pdaf, status_pdaf) ELSE IF (filtertype == 8) THEN ! LEnKF has its own OMI interface routine diff --git a/tutorial/online_2D_parallelmodel_fullpar/g2l_state_pdaf.F90 b/tutorial/online_2D_parallelmodel_fullpar/g2l_state_pdaf.F90 deleted file mode 100644 index 177740d1a..000000000 --- a/tutorial/online_2D_parallelmodel_fullpar/g2l_state_pdaf.F90 +++ /dev/null @@ -1,49 +0,0 @@ -!> Restrict a model state to a local analysis domain -!! -!! User-supplied call-back routine for PDAF. -!! -!! Used in the filters: LSEIK/LETKF/LESTKF/LNETF -!! -!! The routine is called during the loop over all -!! local analysis domains in PDAF_X_update -!! before the analysis on a single local analysis -!! domain. It has to initialize elements of the -!! state vector for the local analysis domains from -!! the PE-local full state vector. -!! -!! Generic implementation using index vector -!! ID_LSTATE_IN_PSTATE. -!! -!! __Revision history:__ -!! * 2013-02 - Lars Nerger - Initial code -!! * Later revisions - see repository log -!! -SUBROUTINE g2l_state_pdaf(step, domain_p, dim_p, state_p, dim_l, state_l) - - USE mod_assimilation, & - ONLY: id_lstate_in_pstate - - IMPLICIT NONE - -! *** Arguments *** - INTEGER, INTENT(in) :: step !< Current time step - INTEGER, INTENT(in) :: domain_p !< Current local analysis domain - INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension - INTEGER, INTENT(in) :: dim_l !< Local state dimension - REAL, INTENT(in) :: state_p(dim_p) !< PE-local full state vector - REAL, INTENT(out) :: state_l(dim_l) !< State vector on local analysis domain - -! *** local variables *** - INTEGER :: i ! Counter - - -! ************************************* -! *** Initialize local state vector *** -! ************************************* - - ! Generic initialization using ID_LSTATE_IN_PSTATE set in INIT_DIM_L_PDAF - DO i = 1, dim_l - state_l(i) = state_p(id_lstate_in_pstate(i)) - END DO - -END SUBROUTINE g2l_state_pdaf diff --git a/tutorial/online_2D_parallelmodel_fullpar/init_dim_l_pdaf.F90 b/tutorial/online_2D_parallelmodel_fullpar/init_dim_l_pdaf.F90 index c9425efb5..70aea27f7 100644 --- a/tutorial/online_2D_parallelmodel_fullpar/init_dim_l_pdaf.F90 +++ b/tutorial/online_2D_parallelmodel_fullpar/init_dim_l_pdaf.F90 @@ -16,10 +16,12 @@ !! SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) + USE PDAFlocal, & ! Routine to provide local indices to PDAF + ONLY: PDAFlocal_set_indices USE mod_model, & ! Model variables ONLY: ny, nx_p USE mod_assimilation, & ! Variables for assimilation - ONLY: coords_l, id_lstate_in_pstate + ONLY: coords_l USE mod_parallel_pdaf, & ! assimilation parallelization variables ONLY: mype_filter @@ -33,6 +35,7 @@ SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) ! *** local variables *** INTEGER :: i ! Counters INTEGER :: off_p ! Process-local offset in global state vector + INTEGER, ALLOCATABLE :: id_lstate_in_pstate(:) !< Indices of local state vector in PE-local global state vector ! **************************************** @@ -62,10 +65,15 @@ SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) ! ****************************************************** ! Allocate array - IF (ALLOCATED(id_lstate_in_pstate)) DEALLOCATE(id_lstate_in_pstate) ALLOCATE(id_lstate_in_pstate(dim_l)) ! Here the local domain is a single grid point and variable given by DOMAIN_P id_lstate_in_pstate(1) = domain_p + ! Provide the index vector to PDAF + CALL PDAFlocal_set_indices(dim_l, id_lstate_in_pstate) + + ! Deallocate index array + DEALLOCATE(id_lstate_in_pstate) + END SUBROUTINE init_dim_l_pdaf diff --git a/tutorial/online_2D_parallelmodel_fullpar/l2g_state_pdaf.F90 b/tutorial/online_2D_parallelmodel_fullpar/l2g_state_pdaf.F90 deleted file mode 100644 index 1a27e44f2..000000000 --- a/tutorial/online_2D_parallelmodel_fullpar/l2g_state_pdaf.F90 +++ /dev/null @@ -1,50 +0,0 @@ -!> Initialize full state from local analysis -!! -!! User-supplied call-back routine for PDAF. -!! -!! Used in the filters: LSEIK/LETKF/LESTKF/LNETF -!! -!! The routine is called during the loop over all -!! local analysis domains in PDAF_X_update -!! after the analysis and ensemble transformation -!! on a single local analysis domain. It has to -!! initialize elements of the PE-local full state -!! vector from the provided analysis state vector -!! on the local analysis domain. -!! -!! Generic implementation using index vector -!! ID_LSTATE_IN_PSTATE. -!! -!! __Revision history:__ -!! * 2013-02 - Lars Nerger - Initial code -!! * Later revisions - see repository log -!! -SUBROUTINE l2g_state_pdaf(step, domain_p, dim_l, state_l, dim_p, state_p) - - USE mod_assimilation, & - ONLY: id_lstate_in_pstate - - IMPLICIT NONE - -! *** Arguments *** - INTEGER, INTENT(in) :: step !< Current time step - INTEGER, INTENT(in) :: domain_p !< Current local analysis domain - INTEGER, INTENT(in) :: dim_l !< Local state dimension - INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension - REAL, INTENT(in) :: state_l(dim_l) !< State vector on local analysis domain - REAL, INTENT(inout) :: state_p(dim_p) !< PE-local full state vector - -! *** local variables *** - INTEGER :: i ! Counter - - -! ************************************************** -! *** Initialize elements of global state vector *** -! ************************************************** - - ! Generic initialization using ID_LSTATE_IN_PSTATE set in INIT_DIM_L_PDAF - DO i = 1, dim_l - state_p(id_lstate_in_pstate(i)) = state_l(i) - END DO - -END SUBROUTINE l2g_state_pdaf diff --git a/tutorial/online_2D_parallelmodel_fullpar/mod_assimilation.F90 b/tutorial/online_2D_parallelmodel_fullpar/mod_assimilation.F90 index 62cc896c0..0e5d6cc05 100644 --- a/tutorial/online_2D_parallelmodel_fullpar/mod_assimilation.F90 +++ b/tutorial/online_2D_parallelmodel_fullpar/mod_assimilation.F90 @@ -28,9 +28,9 @@ MODULE mod_assimilation ! *** Variables specific for model setup *** REAL :: coords_l(2) !< Coordinates of local analysis domain - INTEGER, ALLOCATABLE :: id_lstate_in_pstate(:) !< Indices of local state vector in PE-local global state vector - ! Variables to handle multiple fields in the state vector +! *** Variables to handle multiple fields in the state vector *** + INTEGER :: n_fields !< number of fields in state vector INTEGER, ALLOCATABLE :: off_fields(:) !< Offsets of fields in state vector INTEGER, ALLOCATABLE :: dim_fields(:) !< Dimension of fields in state vector @@ -45,7 +45,7 @@ MODULE mod_assimilation ! Type variable holding field IDs in state vector TYPE(field_ids) :: id -!$OMP THREADPRIVATE(coords_l, id_lstate_in_pstate) +!$OMP THREADPRIVATE(coords_l) ! ----------------------------------------------------------------- @@ -70,18 +70,12 @@ MODULE mod_assimilation !< * (1) progress info !< * (2) add timings !< * (3) debugging output - INTEGER :: dim_ens !< Size of ensemble for SEIK/LSEIK/EnKF/ETKF \n - !< Number of EOFs to be used for SEEK + INTEGER :: dim_ens !< Size of ensemble INTEGER :: filtertype !< Select filter algorithm: - !< * SEEK (0), SEIK (1), EnKF (2), LSEIK (3), ETKF (4) + !< * SEIK (1), EnKF (2), LSEIK (3), ETKF (4) !< LETKF (5), ESTKF (6), LESTKF (7), NETF (9), LNETF (10) !< LKNETF (11), PF (12), GENOBS (100), 3DVAR (200) INTEGER :: subtype !< Subtype of filter algorithm - !< * SEEK: - !< (0) evolve normalized modes - !< (1) evolve scaled modes with unit U - !< (2) fixed basis (V); variable U matrix - !< (3) fixed covar matrix (V,U kept static) !< * SEIK: !< (0) ensemble forecast; new formulation !< (1) ensemble forecast; old formulation @@ -155,9 +149,6 @@ MODULE mod_assimilation !< (4) regulated localization of R with single-point error variance REAL :: sradius !< Support radius for 5th order polynomial !< or radius for 1/e for exponential weighting -! ! SEEK - INTEGER :: int_rediag !< Interval to perform re-diagonalization in SEEK - REAL :: epsilon !< Epsilon for gradient approx. in SEEK forecast ! ! ENKF INTEGER :: rank_ana_enkf !< Rank to be considered for inversion of HPH in analysis of EnKF !< (0) for analysis w/o eigendecomposition diff --git a/tutorial/online_2D_parallelmodel_fullpar/parser_mpi.F90 b/tutorial/online_2D_parallelmodel_fullpar/parser_mpi.F90 index 4269eed43..6ddcbb65d 100644 --- a/tutorial/online_2D_parallelmodel_fullpar/parser_mpi.F90 +++ b/tutorial/online_2D_parallelmodel_fullpar/parser_mpi.F90 @@ -47,12 +47,14 @@ !! to be specified as 'T' or 'F'. !! !! __Revision history:__ -!! * 2019-06 - Stephan Frickenhaus, Lars Nerger - Initial code +!! * 2003-02 - Stephan Frickenhaus, Lars Nerger - Initial code !! * Later revisions - see repository log !! MODULE parser use mpi + USE mod_parallel_model, & + ONLY: abort_parallel IMPLICIT NONE SAVE @@ -187,6 +189,8 @@ SUBROUTINE parse_string(handle, charvalue) ! *** local variables *** CHARACTER(len=100) :: string CHARACTER(len=100) :: parsed_string + CHARACTER(len=110) :: str1_check + CHARACTER(len=110) :: str2_check LOGICAL :: modified ! *** Initialize *** @@ -206,9 +210,27 @@ SUBROUTINE parse_string(handle, charvalue) DO i = 1, command_argument_count() - 1 CALL get_command_argument(i, str1) CALL get_command_argument(i+1, str2) + + ! Add check for inadmissible strings longer than 100 + ! characters + CALL get_command_argument(i, str1_check) + CALL get_command_argument(i+1, str2_check) + IF (mype == 0) THEN + IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN + WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long." + WRITE (*,'(2x, a, 1x, a)') "called handle=", TRIM(string) + WRITE (*,'(2x, a, 1x, a)') "parsed handle=", TRIM(str1) + WRITE (*,'(2x, a, 1x, a)') "parsed input(cut)=", TRIM(str2) + call abort_parallel() + END IF + END IF + + #endif IF (str1 == TRIM(string)) THEN - READ(str2, *) parsed_string + ! Format specifier is needed for reading paths. Using + ! `*` as format specifier, reading stops at a `/` + READ(str2, '(a)') parsed_string modified = .TRUE. END IF ENDDO diff --git a/tutorial/online_2D_parallelmodel_fullpar_1fpe/Makefile b/tutorial/online_2D_parallelmodel_fullpar_1fpe/Makefile index 90200607e..5a8e91cea 100644 --- a/tutorial/online_2D_parallelmodel_fullpar_1fpe/Makefile +++ b/tutorial/online_2D_parallelmodel_fullpar_1fpe/Makefile @@ -70,9 +70,7 @@ OBJ_USER_GEN = init_ens_pdaf.o \ # User-supplied routines for localized analysis (LESTKF/LSEIK/LETKF) OBJ_USER_LOCAL = init_n_domains_pdaf.o \ - init_dim_l_pdaf.o \ - g2l_state_pdaf.o \ - l2g_state_pdaf.o + init_dim_l_pdaf.o # Full list of user-supplied routines for online modes OBJ_PDAF_USER = $(OBJ_USER_PDAFOMI) $(OBJ_PDAF_INT) $(OBJ_USER_GEN) $(OBJ_USER_LOCAL) @@ -108,7 +106,7 @@ model_pdaf : libpdaf-d.a \ libpdaf-d.a: @echo "++++++ Generate Filter library ++++++" - @cd $(BASEDIR)/src; make; + @cd $(BASEDIR); make; ###################################################### @@ -131,7 +129,7 @@ clean : cleanpdaf: @echo "+++ Clean up PDAF directory" - cd $(BASEDIR)/src; make clean + cd $(BASEDIR); make clean cleandata: rm -f ens*ana.txt ens*for.txt state_*ana.txt state_*for.txt diff --git a/tutorial/online_2D_parallelmodel_fullpar_1fpe/assimilate_pdaf.F90 b/tutorial/online_2D_parallelmodel_fullpar_1fpe/assimilate_pdaf.F90 index 53ac9324c..ab3397b58 100644 --- a/tutorial/online_2D_parallelmodel_fullpar_1fpe/assimilate_pdaf.F90 +++ b/tutorial/online_2D_parallelmodel_fullpar_1fpe/assimilate_pdaf.F90 @@ -11,9 +11,11 @@ !! SUBROUTINE assimilate_pdaf() - USE pdaf_interfaces_module, & ! Interface definitions to PDAF core routines + USE PDAF_interfaces_module, & ! Interface definitions to PDAF core routines ONLY: PDAFomi_assimilate_local, PDAFomi_assimilate_global, & PDAFomi_assimilate_lenkf, PDAF_get_localfilter + USE PDAFlocal, & ! Interface definitions for PDAFlocal + ONLY: PDAFlocalomi_put_state USE mod_parallel_model, & ! Parallelization ONLY: mype_world, abort_parallel USE mod_assimilation, & ! Variables for assimilation @@ -40,9 +42,7 @@ SUBROUTINE assimilate_pdaf() prepoststep_pdaf ! User supplied pre/poststep routine ! Localization of state vector EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains - init_dim_l_pdaf, & ! Initialize state dimension for local analysis domain - g2l_state_pdaf, & ! Get state on local analysis domain from global state - l2g_state_pdaf ! Update global state from state on local analysis domain + init_dim_l_pdaf ! Initialize state dimension for local analysis domain ! Interface to PDAF-OMI for local and global filters EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain @@ -60,10 +60,9 @@ SUBROUTINE assimilate_pdaf() ! Call assimilate routine for global or local filter IF (localfilter == 1) THEN ! Call generic OMI interface routine for domain-localized filters - CALL PDAFomi_assimilate_local(collect_state_pdaf, distribute_state_pdaf, & + CALL PDAFlocalomi_assimilate(collect_state_pdaf, distribute_state_pdaf, & init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & - init_dim_l_pdaf, init_dim_obs_l_pdafomi, g2l_state_pdaf, l2g_state_pdaf, & - next_observation_pdaf, status_pdaf) + init_dim_l_pdaf, init_dim_obs_l_pdafomi, next_observation_pdaf, status_pdaf) ELSE IF (filtertype == 8) THEN ! LEnKF has its own OMI interface routine diff --git a/tutorial/online_2D_parallelmodel_fullpar_1fpe/g2l_state_pdaf.F90 b/tutorial/online_2D_parallelmodel_fullpar_1fpe/g2l_state_pdaf.F90 deleted file mode 100644 index 177740d1a..000000000 --- a/tutorial/online_2D_parallelmodel_fullpar_1fpe/g2l_state_pdaf.F90 +++ /dev/null @@ -1,49 +0,0 @@ -!> Restrict a model state to a local analysis domain -!! -!! User-supplied call-back routine for PDAF. -!! -!! Used in the filters: LSEIK/LETKF/LESTKF/LNETF -!! -!! The routine is called during the loop over all -!! local analysis domains in PDAF_X_update -!! before the analysis on a single local analysis -!! domain. It has to initialize elements of the -!! state vector for the local analysis domains from -!! the PE-local full state vector. -!! -!! Generic implementation using index vector -!! ID_LSTATE_IN_PSTATE. -!! -!! __Revision history:__ -!! * 2013-02 - Lars Nerger - Initial code -!! * Later revisions - see repository log -!! -SUBROUTINE g2l_state_pdaf(step, domain_p, dim_p, state_p, dim_l, state_l) - - USE mod_assimilation, & - ONLY: id_lstate_in_pstate - - IMPLICIT NONE - -! *** Arguments *** - INTEGER, INTENT(in) :: step !< Current time step - INTEGER, INTENT(in) :: domain_p !< Current local analysis domain - INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension - INTEGER, INTENT(in) :: dim_l !< Local state dimension - REAL, INTENT(in) :: state_p(dim_p) !< PE-local full state vector - REAL, INTENT(out) :: state_l(dim_l) !< State vector on local analysis domain - -! *** local variables *** - INTEGER :: i ! Counter - - -! ************************************* -! *** Initialize local state vector *** -! ************************************* - - ! Generic initialization using ID_LSTATE_IN_PSTATE set in INIT_DIM_L_PDAF - DO i = 1, dim_l - state_l(i) = state_p(id_lstate_in_pstate(i)) - END DO - -END SUBROUTINE g2l_state_pdaf diff --git a/tutorial/online_2D_parallelmodel_fullpar_1fpe/init_dim_l_pdaf.F90 b/tutorial/online_2D_parallelmodel_fullpar_1fpe/init_dim_l_pdaf.F90 index c9425efb5..70aea27f7 100644 --- a/tutorial/online_2D_parallelmodel_fullpar_1fpe/init_dim_l_pdaf.F90 +++ b/tutorial/online_2D_parallelmodel_fullpar_1fpe/init_dim_l_pdaf.F90 @@ -16,10 +16,12 @@ !! SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) + USE PDAFlocal, & ! Routine to provide local indices to PDAF + ONLY: PDAFlocal_set_indices USE mod_model, & ! Model variables ONLY: ny, nx_p USE mod_assimilation, & ! Variables for assimilation - ONLY: coords_l, id_lstate_in_pstate + ONLY: coords_l USE mod_parallel_pdaf, & ! assimilation parallelization variables ONLY: mype_filter @@ -33,6 +35,7 @@ SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) ! *** local variables *** INTEGER :: i ! Counters INTEGER :: off_p ! Process-local offset in global state vector + INTEGER, ALLOCATABLE :: id_lstate_in_pstate(:) !< Indices of local state vector in PE-local global state vector ! **************************************** @@ -62,10 +65,15 @@ SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) ! ****************************************************** ! Allocate array - IF (ALLOCATED(id_lstate_in_pstate)) DEALLOCATE(id_lstate_in_pstate) ALLOCATE(id_lstate_in_pstate(dim_l)) ! Here the local domain is a single grid point and variable given by DOMAIN_P id_lstate_in_pstate(1) = domain_p + ! Provide the index vector to PDAF + CALL PDAFlocal_set_indices(dim_l, id_lstate_in_pstate) + + ! Deallocate index array + DEALLOCATE(id_lstate_in_pstate) + END SUBROUTINE init_dim_l_pdaf diff --git a/tutorial/online_2D_parallelmodel_fullpar_1fpe/l2g_state_pdaf.F90 b/tutorial/online_2D_parallelmodel_fullpar_1fpe/l2g_state_pdaf.F90 deleted file mode 100644 index 1a27e44f2..000000000 --- a/tutorial/online_2D_parallelmodel_fullpar_1fpe/l2g_state_pdaf.F90 +++ /dev/null @@ -1,50 +0,0 @@ -!> Initialize full state from local analysis -!! -!! User-supplied call-back routine for PDAF. -!! -!! Used in the filters: LSEIK/LETKF/LESTKF/LNETF -!! -!! The routine is called during the loop over all -!! local analysis domains in PDAF_X_update -!! after the analysis and ensemble transformation -!! on a single local analysis domain. It has to -!! initialize elements of the PE-local full state -!! vector from the provided analysis state vector -!! on the local analysis domain. -!! -!! Generic implementation using index vector -!! ID_LSTATE_IN_PSTATE. -!! -!! __Revision history:__ -!! * 2013-02 - Lars Nerger - Initial code -!! * Later revisions - see repository log -!! -SUBROUTINE l2g_state_pdaf(step, domain_p, dim_l, state_l, dim_p, state_p) - - USE mod_assimilation, & - ONLY: id_lstate_in_pstate - - IMPLICIT NONE - -! *** Arguments *** - INTEGER, INTENT(in) :: step !< Current time step - INTEGER, INTENT(in) :: domain_p !< Current local analysis domain - INTEGER, INTENT(in) :: dim_l !< Local state dimension - INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension - REAL, INTENT(in) :: state_l(dim_l) !< State vector on local analysis domain - REAL, INTENT(inout) :: state_p(dim_p) !< PE-local full state vector - -! *** local variables *** - INTEGER :: i ! Counter - - -! ************************************************** -! *** Initialize elements of global state vector *** -! ************************************************** - - ! Generic initialization using ID_LSTATE_IN_PSTATE set in INIT_DIM_L_PDAF - DO i = 1, dim_l - state_p(id_lstate_in_pstate(i)) = state_l(i) - END DO - -END SUBROUTINE l2g_state_pdaf diff --git a/tutorial/online_2D_parallelmodel_fullpar_1fpe/mod_assimilation.F90 b/tutorial/online_2D_parallelmodel_fullpar_1fpe/mod_assimilation.F90 index 62cc896c0..0e5d6cc05 100644 --- a/tutorial/online_2D_parallelmodel_fullpar_1fpe/mod_assimilation.F90 +++ b/tutorial/online_2D_parallelmodel_fullpar_1fpe/mod_assimilation.F90 @@ -28,9 +28,9 @@ MODULE mod_assimilation ! *** Variables specific for model setup *** REAL :: coords_l(2) !< Coordinates of local analysis domain - INTEGER, ALLOCATABLE :: id_lstate_in_pstate(:) !< Indices of local state vector in PE-local global state vector - ! Variables to handle multiple fields in the state vector +! *** Variables to handle multiple fields in the state vector *** + INTEGER :: n_fields !< number of fields in state vector INTEGER, ALLOCATABLE :: off_fields(:) !< Offsets of fields in state vector INTEGER, ALLOCATABLE :: dim_fields(:) !< Dimension of fields in state vector @@ -45,7 +45,7 @@ MODULE mod_assimilation ! Type variable holding field IDs in state vector TYPE(field_ids) :: id -!$OMP THREADPRIVATE(coords_l, id_lstate_in_pstate) +!$OMP THREADPRIVATE(coords_l) ! ----------------------------------------------------------------- @@ -70,18 +70,12 @@ MODULE mod_assimilation !< * (1) progress info !< * (2) add timings !< * (3) debugging output - INTEGER :: dim_ens !< Size of ensemble for SEIK/LSEIK/EnKF/ETKF \n - !< Number of EOFs to be used for SEEK + INTEGER :: dim_ens !< Size of ensemble INTEGER :: filtertype !< Select filter algorithm: - !< * SEEK (0), SEIK (1), EnKF (2), LSEIK (3), ETKF (4) + !< * SEIK (1), EnKF (2), LSEIK (3), ETKF (4) !< LETKF (5), ESTKF (6), LESTKF (7), NETF (9), LNETF (10) !< LKNETF (11), PF (12), GENOBS (100), 3DVAR (200) INTEGER :: subtype !< Subtype of filter algorithm - !< * SEEK: - !< (0) evolve normalized modes - !< (1) evolve scaled modes with unit U - !< (2) fixed basis (V); variable U matrix - !< (3) fixed covar matrix (V,U kept static) !< * SEIK: !< (0) ensemble forecast; new formulation !< (1) ensemble forecast; old formulation @@ -155,9 +149,6 @@ MODULE mod_assimilation !< (4) regulated localization of R with single-point error variance REAL :: sradius !< Support radius for 5th order polynomial !< or radius for 1/e for exponential weighting -! ! SEEK - INTEGER :: int_rediag !< Interval to perform re-diagonalization in SEEK - REAL :: epsilon !< Epsilon for gradient approx. in SEEK forecast ! ! ENKF INTEGER :: rank_ana_enkf !< Rank to be considered for inversion of HPH in analysis of EnKF !< (0) for analysis w/o eigendecomposition diff --git a/tutorial/online_2D_parallelmodel_fullpar_1fpe/parser_mpi.F90 b/tutorial/online_2D_parallelmodel_fullpar_1fpe/parser_mpi.F90 index 4269eed43..6ddcbb65d 100644 --- a/tutorial/online_2D_parallelmodel_fullpar_1fpe/parser_mpi.F90 +++ b/tutorial/online_2D_parallelmodel_fullpar_1fpe/parser_mpi.F90 @@ -47,12 +47,14 @@ !! to be specified as 'T' or 'F'. !! !! __Revision history:__ -!! * 2019-06 - Stephan Frickenhaus, Lars Nerger - Initial code +!! * 2003-02 - Stephan Frickenhaus, Lars Nerger - Initial code !! * Later revisions - see repository log !! MODULE parser use mpi + USE mod_parallel_model, & + ONLY: abort_parallel IMPLICIT NONE SAVE @@ -187,6 +189,8 @@ SUBROUTINE parse_string(handle, charvalue) ! *** local variables *** CHARACTER(len=100) :: string CHARACTER(len=100) :: parsed_string + CHARACTER(len=110) :: str1_check + CHARACTER(len=110) :: str2_check LOGICAL :: modified ! *** Initialize *** @@ -206,9 +210,27 @@ SUBROUTINE parse_string(handle, charvalue) DO i = 1, command_argument_count() - 1 CALL get_command_argument(i, str1) CALL get_command_argument(i+1, str2) + + ! Add check for inadmissible strings longer than 100 + ! characters + CALL get_command_argument(i, str1_check) + CALL get_command_argument(i+1, str2_check) + IF (mype == 0) THEN + IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN + WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long." + WRITE (*,'(2x, a, 1x, a)') "called handle=", TRIM(string) + WRITE (*,'(2x, a, 1x, a)') "parsed handle=", TRIM(str1) + WRITE (*,'(2x, a, 1x, a)') "parsed input(cut)=", TRIM(str2) + call abort_parallel() + END IF + END IF + + #endif IF (str1 == TRIM(string)) THEN - READ(str2, *) parsed_string + ! Format specifier is needed for reading paths. Using + ! `*` as format specifier, reading stops at a `/` + READ(str2, '(a)') parsed_string modified = .TRUE. END IF ENDDO diff --git a/tutorial/online_2D_serialmodel/Makefile b/tutorial/online_2D_serialmodel/Makefile index 61175d6da..71c75282d 100644 --- a/tutorial/online_2D_serialmodel/Makefile +++ b/tutorial/online_2D_serialmodel/Makefile @@ -67,11 +67,9 @@ OBJ_USER_GEN = init_ens_pdaf.o \ distribute_state_pdaf.o \ collect_state_pdaf.o -# User-supplied routines for state in localized analysis (LESTKF/LSEIK/LETKF) +# User-supplied routines for state in localized analysis (LESTKF/LSEIK/LETKF/LNETF/LKNETF) OBJ_USER_LOCAL = init_n_domains_pdaf.o \ - init_dim_l_pdaf.o \ - g2l_state_pdaf.o \ - l2g_state_pdaf.o + init_dim_l_pdaf.o # Full list of user-supplied routines for online mode OBJ_PDAF_USER = $(OBJ_USER_PDAFOMI) $(OBJ_PDAF_INT) $(OBJ_USER_GEN) $(OBJ_USER_LOCAL) @@ -106,7 +104,7 @@ model_pdaf : libpdaf-d.a \ libpdaf-d.a: @echo "++++++ Generate Filter library ++++++" - @cd $(BASEDIR)/src; make; + @cd $(BASEDIR); make; ###################################################### @@ -131,7 +129,7 @@ clean : cleanpdaf: @echo "+++ Clean up PDAF directory" - cd $(BASEDIR)/src; make clean + cd $(BASEDIR); make clean cleandata: rm -f ens*ana.txt ens*for.txt state_*ana.txt state_*for.txt diff --git a/tutorial/online_2D_serialmodel/assimilate_pdaf.F90 b/tutorial/online_2D_serialmodel/assimilate_pdaf.F90 index 6c24fd4c3..f6250c4bf 100644 --- a/tutorial/online_2D_serialmodel/assimilate_pdaf.F90 +++ b/tutorial/online_2D_serialmodel/assimilate_pdaf.F90 @@ -11,9 +11,11 @@ !! SUBROUTINE assimilate_pdaf() - USE pdaf_interfaces_module, & ! Interface definitions to PDAF core routines + USE PDAF_interfaces_module, & ! Interface definitions to PDAF core routines ONLY: PDAFomi_assimilate_local, PDAFomi_assimilate_global, & PDAFomi_assimilate_lenkf, PDAF_get_localfilter + USE PDAFlocal, & ! Interface definitions for PDAFlocal + ONLY: PDAFlocalomi_put_state USE mod_parallel_pdaf, & ! Parallelization variables ONLY: mype_world, abort_parallel USE mod_assimilation, & ! Variables for assimilation @@ -40,9 +42,7 @@ SUBROUTINE assimilate_pdaf() prepoststep_pdaf ! User supplied pre/poststep routine ! Localization of state vector EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains - init_dim_l_pdaf, & ! Initialize state dimension for local analysis domain - g2l_state_pdaf, & ! Get state on local analysis domain from global state - l2g_state_pdaf ! Update global state from state on local analysis domain + init_dim_l_pdaf ! Initialize state dimension for local analysis domain ! Interface to PDAF-OMI for local and global filters EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain @@ -60,10 +60,9 @@ SUBROUTINE assimilate_pdaf() ! Call assimilate routine for global or local filter IF (localfilter == 1) THEN ! Call generic OMI interface routine for domain-localized filters - CALL PDAFomi_assimilate_local(collect_state_pdaf, distribute_state_pdaf, & + CALL PDAFlocalomi_assimilate(collect_state_pdaf, distribute_state_pdaf, & init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & - init_dim_l_pdaf, init_dim_obs_l_pdafomi, g2l_state_pdaf, l2g_state_pdaf, & - next_observation_pdaf, status_pdaf) + init_dim_l_pdaf, init_dim_obs_l_pdafomi, next_observation_pdaf, status_pdaf) ELSE IF (filtertype == 8) THEN ! LEnKF has its own OMI interface routine diff --git a/tutorial/online_2D_serialmodel/g2l_state_pdaf.F90 b/tutorial/online_2D_serialmodel/g2l_state_pdaf.F90 deleted file mode 100644 index 177740d1a..000000000 --- a/tutorial/online_2D_serialmodel/g2l_state_pdaf.F90 +++ /dev/null @@ -1,49 +0,0 @@ -!> Restrict a model state to a local analysis domain -!! -!! User-supplied call-back routine for PDAF. -!! -!! Used in the filters: LSEIK/LETKF/LESTKF/LNETF -!! -!! The routine is called during the loop over all -!! local analysis domains in PDAF_X_update -!! before the analysis on a single local analysis -!! domain. It has to initialize elements of the -!! state vector for the local analysis domains from -!! the PE-local full state vector. -!! -!! Generic implementation using index vector -!! ID_LSTATE_IN_PSTATE. -!! -!! __Revision history:__ -!! * 2013-02 - Lars Nerger - Initial code -!! * Later revisions - see repository log -!! -SUBROUTINE g2l_state_pdaf(step, domain_p, dim_p, state_p, dim_l, state_l) - - USE mod_assimilation, & - ONLY: id_lstate_in_pstate - - IMPLICIT NONE - -! *** Arguments *** - INTEGER, INTENT(in) :: step !< Current time step - INTEGER, INTENT(in) :: domain_p !< Current local analysis domain - INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension - INTEGER, INTENT(in) :: dim_l !< Local state dimension - REAL, INTENT(in) :: state_p(dim_p) !< PE-local full state vector - REAL, INTENT(out) :: state_l(dim_l) !< State vector on local analysis domain - -! *** local variables *** - INTEGER :: i ! Counter - - -! ************************************* -! *** Initialize local state vector *** -! ************************************* - - ! Generic initialization using ID_LSTATE_IN_PSTATE set in INIT_DIM_L_PDAF - DO i = 1, dim_l - state_l(i) = state_p(id_lstate_in_pstate(i)) - END DO - -END SUBROUTINE g2l_state_pdaf diff --git a/tutorial/online_2D_serialmodel/init_dim_l_pdaf.F90 b/tutorial/online_2D_serialmodel/init_dim_l_pdaf.F90 index 711074f13..3d751a495 100644 --- a/tutorial/online_2D_serialmodel/init_dim_l_pdaf.F90 +++ b/tutorial/online_2D_serialmodel/init_dim_l_pdaf.F90 @@ -16,10 +16,12 @@ !! SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) + USE PDAFlocal, & ! Routine to provide local indices to PDAF + ONLY: PDAFlocal_set_indices USE mod_model, & ! Model variables ONLY: ny USE mod_assimilation, & ! Variables for assimilation - ONLY: coords_l, id_lstate_in_pstate + ONLY: coords_l IMPLICIT NONE @@ -28,6 +30,9 @@ SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) INTEGER, INTENT(in) :: domain_p !< Current local analysis domain INTEGER, INTENT(out) :: dim_l !< Local state dimension +! *** local variables *** + INTEGER, ALLOCATABLE :: id_lstate_in_pstate(:) !< Indices of local state vector in PE-local global state vector + ! **************************************** ! *** Initialize local state dimension *** @@ -51,10 +56,15 @@ SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) ! ****************************************************** ! Allocate array - IF (ALLOCATED(id_lstate_in_pstate)) DEALLOCATE(id_lstate_in_pstate) ALLOCATE(id_lstate_in_pstate(dim_l)) ! Here the local domain is a single grid point and variable given by DOMAIN_P id_lstate_in_pstate(1) = domain_p + ! Provide the index vector to PDAF + CALL PDAFlocal_set_indices(dim_l, id_lstate_in_pstate) + + ! Deallocate index array + DEALLOCATE(id_lstate_in_pstate) + END SUBROUTINE init_dim_l_pdaf diff --git a/tutorial/online_2D_serialmodel/l2g_state_pdaf.F90 b/tutorial/online_2D_serialmodel/l2g_state_pdaf.F90 deleted file mode 100644 index 1a27e44f2..000000000 --- a/tutorial/online_2D_serialmodel/l2g_state_pdaf.F90 +++ /dev/null @@ -1,50 +0,0 @@ -!> Initialize full state from local analysis -!! -!! User-supplied call-back routine for PDAF. -!! -!! Used in the filters: LSEIK/LETKF/LESTKF/LNETF -!! -!! The routine is called during the loop over all -!! local analysis domains in PDAF_X_update -!! after the analysis and ensemble transformation -!! on a single local analysis domain. It has to -!! initialize elements of the PE-local full state -!! vector from the provided analysis state vector -!! on the local analysis domain. -!! -!! Generic implementation using index vector -!! ID_LSTATE_IN_PSTATE. -!! -!! __Revision history:__ -!! * 2013-02 - Lars Nerger - Initial code -!! * Later revisions - see repository log -!! -SUBROUTINE l2g_state_pdaf(step, domain_p, dim_l, state_l, dim_p, state_p) - - USE mod_assimilation, & - ONLY: id_lstate_in_pstate - - IMPLICIT NONE - -! *** Arguments *** - INTEGER, INTENT(in) :: step !< Current time step - INTEGER, INTENT(in) :: domain_p !< Current local analysis domain - INTEGER, INTENT(in) :: dim_l !< Local state dimension - INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension - REAL, INTENT(in) :: state_l(dim_l) !< State vector on local analysis domain - REAL, INTENT(inout) :: state_p(dim_p) !< PE-local full state vector - -! *** local variables *** - INTEGER :: i ! Counter - - -! ************************************************** -! *** Initialize elements of global state vector *** -! ************************************************** - - ! Generic initialization using ID_LSTATE_IN_PSTATE set in INIT_DIM_L_PDAF - DO i = 1, dim_l - state_p(id_lstate_in_pstate(i)) = state_l(i) - END DO - -END SUBROUTINE l2g_state_pdaf diff --git a/tutorial/online_2D_serialmodel/mod_assimilation.F90 b/tutorial/online_2D_serialmodel/mod_assimilation.F90 index e49ed406b..0e5d6cc05 100644 --- a/tutorial/online_2D_serialmodel/mod_assimilation.F90 +++ b/tutorial/online_2D_serialmodel/mod_assimilation.F90 @@ -28,7 +28,6 @@ MODULE mod_assimilation ! *** Variables specific for model setup *** REAL :: coords_l(2) !< Coordinates of local analysis domain - INTEGER, ALLOCATABLE :: id_lstate_in_pstate(:) !< Indices of local state vector in PE-local global state vector ! *** Variables to handle multiple fields in the state vector *** @@ -46,7 +45,7 @@ MODULE mod_assimilation ! Type variable holding field IDs in state vector TYPE(field_ids) :: id -!$OMP THREADPRIVATE(coords_l, id_lstate_in_pstate) +!$OMP THREADPRIVATE(coords_l) ! ----------------------------------------------------------------- @@ -71,18 +70,12 @@ MODULE mod_assimilation !< * (1) progress info !< * (2) add timings !< * (3) debugging output - INTEGER :: dim_ens !< Size of ensemble for SEIK/LSEIK/EnKF/ETKF \n - !< Number of EOFs to be used for SEEK + INTEGER :: dim_ens !< Size of ensemble INTEGER :: filtertype !< Select filter algorithm: - !< * SEEK (0), SEIK (1), EnKF (2), LSEIK (3), ETKF (4) + !< * SEIK (1), EnKF (2), LSEIK (3), ETKF (4) !< LETKF (5), ESTKF (6), LESTKF (7), NETF (9), LNETF (10) !< LKNETF (11), PF (12), GENOBS (100), 3DVAR (200) INTEGER :: subtype !< Subtype of filter algorithm - !< * SEEK: - !< (0) evolve normalized modes - !< (1) evolve scaled modes with unit U - !< (2) fixed basis (V); variable U matrix - !< (3) fixed covar matrix (V,U kept static) !< * SEIK: !< (0) ensemble forecast; new formulation !< (1) ensemble forecast; old formulation @@ -156,9 +149,6 @@ MODULE mod_assimilation !< (4) regulated localization of R with single-point error variance REAL :: sradius !< Support radius for 5th order polynomial !< or radius for 1/e for exponential weighting -! ! SEEK - INTEGER :: int_rediag !< Interval to perform re-diagonalization in SEEK - REAL :: epsilon !< Epsilon for gradient approx. in SEEK forecast ! ! ENKF INTEGER :: rank_ana_enkf !< Rank to be considered for inversion of HPH in analysis of EnKF !< (0) for analysis w/o eigendecomposition diff --git a/tutorial/online_2D_serialmodel/parser_mpi.F90 b/tutorial/online_2D_serialmodel/parser_mpi.F90 index 4269eed43..40258b6ac 100644 --- a/tutorial/online_2D_serialmodel/parser_mpi.F90 +++ b/tutorial/online_2D_serialmodel/parser_mpi.F90 @@ -47,12 +47,14 @@ !! to be specified as 'T' or 'F'. !! !! __Revision history:__ -!! * 2019-06 - Stephan Frickenhaus, Lars Nerger - Initial code +!! * 2003-02 - Stephan Frickenhaus, Lars Nerger - Initial code !! * Later revisions - see repository log !! MODULE parser use mpi + USE mod_parallel_pdaf, & + ONLY: abort_parallel IMPLICIT NONE SAVE @@ -187,6 +189,8 @@ SUBROUTINE parse_string(handle, charvalue) ! *** local variables *** CHARACTER(len=100) :: string CHARACTER(len=100) :: parsed_string + CHARACTER(len=110) :: str1_check + CHARACTER(len=110) :: str2_check LOGICAL :: modified ! *** Initialize *** @@ -206,9 +210,27 @@ SUBROUTINE parse_string(handle, charvalue) DO i = 1, command_argument_count() - 1 CALL get_command_argument(i, str1) CALL get_command_argument(i+1, str2) + + ! Add check for inadmissible strings longer than 100 + ! characters + CALL get_command_argument(i, str1_check) + CALL get_command_argument(i+1, str2_check) + IF (mype == 0) THEN + IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN + WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long." + WRITE (*,'(2x, a, 1x, a)') "called handle=", TRIM(string) + WRITE (*,'(2x, a, 1x, a)') "parsed handle=", TRIM(str1) + WRITE (*,'(2x, a, 1x, a)') "parsed input(cut)=", TRIM(str2) + call abort_parallel() + END IF + END IF + + #endif IF (str1 == TRIM(string)) THEN - READ(str2, *) parsed_string + ! Format specifier is needed for reading paths. Using + ! `*` as format specifier, reading stops at a `/` + READ(str2, '(a)') parsed_string modified = .TRUE. END IF ENDDO diff --git a/tutorial/online_2D_serialmodel_2fields/Makefile b/tutorial/online_2D_serialmodel_2fields/Makefile index 36c8b2902..091ae63ed 100644 --- a/tutorial/online_2D_serialmodel_2fields/Makefile +++ b/tutorial/online_2D_serialmodel_2fields/Makefile @@ -66,11 +66,9 @@ OBJ_USER_GEN = init_ens_pdaf.o \ distribute_state_pdaf.o \ collect_state_pdaf.o -# User-supplied routines for state in localized analysis (LESTKF/LSEIK/LETKF) +# User-supplied routines for state in localized analysis (LESTKF/LSEIK/LETKF/LNETF/LKNETF) OBJ_USER_LOCAL = init_n_domains_pdaf.o \ - init_dim_l_pdaf.o \ - g2l_state_pdaf.o \ - l2g_state_pdaf.o + init_dim_l_pdaf.o # Full list of user-supplied routines for online mode OBJ_PDAF_USER = $(OBJ_USER_PDAFOMI) $(OBJ_PDAF_INT) $(OBJ_USER_GEN) $(OBJ_USER_LOCAL) @@ -105,7 +103,7 @@ model_pdaf : libpdaf-d.a \ libpdaf-d.a: @echo "++++++ Generate Filter library ++++++" - @cd $(BASEDIR)/src; make; + @cd $(BASEDIR); make; ###################################################### @@ -130,7 +128,7 @@ clean : cleanpdaf: @echo "+++ Clean up PDAF directory" - cd $(BASEDIR)/src; make clean + cd $(BASEDIR); make clean cleandata: rm -f ens*ana.txt ens*for.txt state_*ana.txt state_*for.txt stateB_*txt ensB*.txt diff --git a/tutorial/online_2D_serialmodel_2fields/assimilate_pdaf.F90 b/tutorial/online_2D_serialmodel_2fields/assimilate_pdaf.F90 index 6c24fd4c3..f6250c4bf 100644 --- a/tutorial/online_2D_serialmodel_2fields/assimilate_pdaf.F90 +++ b/tutorial/online_2D_serialmodel_2fields/assimilate_pdaf.F90 @@ -11,9 +11,11 @@ !! SUBROUTINE assimilate_pdaf() - USE pdaf_interfaces_module, & ! Interface definitions to PDAF core routines + USE PDAF_interfaces_module, & ! Interface definitions to PDAF core routines ONLY: PDAFomi_assimilate_local, PDAFomi_assimilate_global, & PDAFomi_assimilate_lenkf, PDAF_get_localfilter + USE PDAFlocal, & ! Interface definitions for PDAFlocal + ONLY: PDAFlocalomi_put_state USE mod_parallel_pdaf, & ! Parallelization variables ONLY: mype_world, abort_parallel USE mod_assimilation, & ! Variables for assimilation @@ -40,9 +42,7 @@ SUBROUTINE assimilate_pdaf() prepoststep_pdaf ! User supplied pre/poststep routine ! Localization of state vector EXTERNAL :: init_n_domains_pdaf, & ! Provide number of local analysis domains - init_dim_l_pdaf, & ! Initialize state dimension for local analysis domain - g2l_state_pdaf, & ! Get state on local analysis domain from global state - l2g_state_pdaf ! Update global state from state on local analysis domain + init_dim_l_pdaf ! Initialize state dimension for local analysis domain ! Interface to PDAF-OMI for local and global filters EXTERNAL :: init_dim_obs_pdafomi, & ! Get dimension of full obs. vector for PE-local domain obs_op_pdafomi, & ! Obs. operator for full obs. vector for PE-local domain @@ -60,10 +60,9 @@ SUBROUTINE assimilate_pdaf() ! Call assimilate routine for global or local filter IF (localfilter == 1) THEN ! Call generic OMI interface routine for domain-localized filters - CALL PDAFomi_assimilate_local(collect_state_pdaf, distribute_state_pdaf, & + CALL PDAFlocalomi_assimilate(collect_state_pdaf, distribute_state_pdaf, & init_dim_obs_pdafomi, obs_op_pdafomi, prepoststep_pdaf, init_n_domains_pdaf, & - init_dim_l_pdaf, init_dim_obs_l_pdafomi, g2l_state_pdaf, l2g_state_pdaf, & - next_observation_pdaf, status_pdaf) + init_dim_l_pdaf, init_dim_obs_l_pdafomi, next_observation_pdaf, status_pdaf) ELSE IF (filtertype == 8) THEN ! LEnKF has its own OMI interface routine diff --git a/tutorial/online_2D_serialmodel_2fields/g2l_state_pdaf.F90 b/tutorial/online_2D_serialmodel_2fields/g2l_state_pdaf.F90 deleted file mode 100644 index 177740d1a..000000000 --- a/tutorial/online_2D_serialmodel_2fields/g2l_state_pdaf.F90 +++ /dev/null @@ -1,49 +0,0 @@ -!> Restrict a model state to a local analysis domain -!! -!! User-supplied call-back routine for PDAF. -!! -!! Used in the filters: LSEIK/LETKF/LESTKF/LNETF -!! -!! The routine is called during the loop over all -!! local analysis domains in PDAF_X_update -!! before the analysis on a single local analysis -!! domain. It has to initialize elements of the -!! state vector for the local analysis domains from -!! the PE-local full state vector. -!! -!! Generic implementation using index vector -!! ID_LSTATE_IN_PSTATE. -!! -!! __Revision history:__ -!! * 2013-02 - Lars Nerger - Initial code -!! * Later revisions - see repository log -!! -SUBROUTINE g2l_state_pdaf(step, domain_p, dim_p, state_p, dim_l, state_l) - - USE mod_assimilation, & - ONLY: id_lstate_in_pstate - - IMPLICIT NONE - -! *** Arguments *** - INTEGER, INTENT(in) :: step !< Current time step - INTEGER, INTENT(in) :: domain_p !< Current local analysis domain - INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension - INTEGER, INTENT(in) :: dim_l !< Local state dimension - REAL, INTENT(in) :: state_p(dim_p) !< PE-local full state vector - REAL, INTENT(out) :: state_l(dim_l) !< State vector on local analysis domain - -! *** local variables *** - INTEGER :: i ! Counter - - -! ************************************* -! *** Initialize local state vector *** -! ************************************* - - ! Generic initialization using ID_LSTATE_IN_PSTATE set in INIT_DIM_L_PDAF - DO i = 1, dim_l - state_l(i) = state_p(id_lstate_in_pstate(i)) - END DO - -END SUBROUTINE g2l_state_pdaf diff --git a/tutorial/online_2D_serialmodel_2fields/init_dim_l_pdaf.F90 b/tutorial/online_2D_serialmodel_2fields/init_dim_l_pdaf.F90 index aa4912e7b..53f7b8eb7 100644 --- a/tutorial/online_2D_serialmodel_2fields/init_dim_l_pdaf.F90 +++ b/tutorial/online_2D_serialmodel_2fields/init_dim_l_pdaf.F90 @@ -16,10 +16,12 @@ !! SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) + USE PDAFlocal, & ! Routine to provide local indices to PDAF + ONLY: PDAFlocal_set_indices USE mod_model, & ! Model variables ONLY: ny USE mod_assimilation, & ! Variables for assimilation - ONLY: coords_l, id_lstate_in_pstate, n_fields, off_fields + ONLY: coords_l, n_fields, off_fields IMPLICIT NONE @@ -30,6 +32,7 @@ SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) ! *** local variables *** INTEGER :: i ! Counter + INTEGER, ALLOCATABLE :: id_lstate_in_pstate(:) !< Indices of local state vector in PE-local global state vector ! **************************************** @@ -54,7 +57,6 @@ SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) ! ****************************************************** ! Allocate array - IF (ALLOCATED(id_lstate_in_pstate)) DEALLOCATE(id_lstate_in_pstate) ALLOCATE(id_lstate_in_pstate(dim_l)) ! Here the local domain is a single grid point @@ -63,4 +65,10 @@ SUBROUTINE init_dim_l_pdaf(step, domain_p, dim_l) id_lstate_in_pstate(i) = domain_p + off_fields(i) END DO + ! Provide the index vector to PDAF + CALL PDAFlocal_set_indices(dim_l, id_lstate_in_pstate) + + ! Deallocate index array + DEALLOCATE(id_lstate_in_pstate) + END SUBROUTINE init_dim_l_pdaf diff --git a/tutorial/online_2D_serialmodel_2fields/l2g_state_pdaf.F90 b/tutorial/online_2D_serialmodel_2fields/l2g_state_pdaf.F90 deleted file mode 100644 index 1a27e44f2..000000000 --- a/tutorial/online_2D_serialmodel_2fields/l2g_state_pdaf.F90 +++ /dev/null @@ -1,50 +0,0 @@ -!> Initialize full state from local analysis -!! -!! User-supplied call-back routine for PDAF. -!! -!! Used in the filters: LSEIK/LETKF/LESTKF/LNETF -!! -!! The routine is called during the loop over all -!! local analysis domains in PDAF_X_update -!! after the analysis and ensemble transformation -!! on a single local analysis domain. It has to -!! initialize elements of the PE-local full state -!! vector from the provided analysis state vector -!! on the local analysis domain. -!! -!! Generic implementation using index vector -!! ID_LSTATE_IN_PSTATE. -!! -!! __Revision history:__ -!! * 2013-02 - Lars Nerger - Initial code -!! * Later revisions - see repository log -!! -SUBROUTINE l2g_state_pdaf(step, domain_p, dim_l, state_l, dim_p, state_p) - - USE mod_assimilation, & - ONLY: id_lstate_in_pstate - - IMPLICIT NONE - -! *** Arguments *** - INTEGER, INTENT(in) :: step !< Current time step - INTEGER, INTENT(in) :: domain_p !< Current local analysis domain - INTEGER, INTENT(in) :: dim_l !< Local state dimension - INTEGER, INTENT(in) :: dim_p !< PE-local full state dimension - REAL, INTENT(in) :: state_l(dim_l) !< State vector on local analysis domain - REAL, INTENT(inout) :: state_p(dim_p) !< PE-local full state vector - -! *** local variables *** - INTEGER :: i ! Counter - - -! ************************************************** -! *** Initialize elements of global state vector *** -! ************************************************** - - ! Generic initialization using ID_LSTATE_IN_PSTATE set in INIT_DIM_L_PDAF - DO i = 1, dim_l - state_p(id_lstate_in_pstate(i)) = state_l(i) - END DO - -END SUBROUTINE l2g_state_pdaf diff --git a/tutorial/online_2D_serialmodel_2fields/mod_assimilation.F90 b/tutorial/online_2D_serialmodel_2fields/mod_assimilation.F90 index 62cc896c0..0e5d6cc05 100644 --- a/tutorial/online_2D_serialmodel_2fields/mod_assimilation.F90 +++ b/tutorial/online_2D_serialmodel_2fields/mod_assimilation.F90 @@ -28,9 +28,9 @@ MODULE mod_assimilation ! *** Variables specific for model setup *** REAL :: coords_l(2) !< Coordinates of local analysis domain - INTEGER, ALLOCATABLE :: id_lstate_in_pstate(:) !< Indices of local state vector in PE-local global state vector - ! Variables to handle multiple fields in the state vector +! *** Variables to handle multiple fields in the state vector *** + INTEGER :: n_fields !< number of fields in state vector INTEGER, ALLOCATABLE :: off_fields(:) !< Offsets of fields in state vector INTEGER, ALLOCATABLE :: dim_fields(:) !< Dimension of fields in state vector @@ -45,7 +45,7 @@ MODULE mod_assimilation ! Type variable holding field IDs in state vector TYPE(field_ids) :: id -!$OMP THREADPRIVATE(coords_l, id_lstate_in_pstate) +!$OMP THREADPRIVATE(coords_l) ! ----------------------------------------------------------------- @@ -70,18 +70,12 @@ MODULE mod_assimilation !< * (1) progress info !< * (2) add timings !< * (3) debugging output - INTEGER :: dim_ens !< Size of ensemble for SEIK/LSEIK/EnKF/ETKF \n - !< Number of EOFs to be used for SEEK + INTEGER :: dim_ens !< Size of ensemble INTEGER :: filtertype !< Select filter algorithm: - !< * SEEK (0), SEIK (1), EnKF (2), LSEIK (3), ETKF (4) + !< * SEIK (1), EnKF (2), LSEIK (3), ETKF (4) !< LETKF (5), ESTKF (6), LESTKF (7), NETF (9), LNETF (10) !< LKNETF (11), PF (12), GENOBS (100), 3DVAR (200) INTEGER :: subtype !< Subtype of filter algorithm - !< * SEEK: - !< (0) evolve normalized modes - !< (1) evolve scaled modes with unit U - !< (2) fixed basis (V); variable U matrix - !< (3) fixed covar matrix (V,U kept static) !< * SEIK: !< (0) ensemble forecast; new formulation !< (1) ensemble forecast; old formulation @@ -155,9 +149,6 @@ MODULE mod_assimilation !< (4) regulated localization of R with single-point error variance REAL :: sradius !< Support radius for 5th order polynomial !< or radius for 1/e for exponential weighting -! ! SEEK - INTEGER :: int_rediag !< Interval to perform re-diagonalization in SEEK - REAL :: epsilon !< Epsilon for gradient approx. in SEEK forecast ! ! ENKF INTEGER :: rank_ana_enkf !< Rank to be considered for inversion of HPH in analysis of EnKF !< (0) for analysis w/o eigendecomposition diff --git a/tutorial/online_2D_serialmodel_2fields/parser_mpi.F90 b/tutorial/online_2D_serialmodel_2fields/parser_mpi.F90 index 4269eed43..40258b6ac 100644 --- a/tutorial/online_2D_serialmodel_2fields/parser_mpi.F90 +++ b/tutorial/online_2D_serialmodel_2fields/parser_mpi.F90 @@ -47,12 +47,14 @@ !! to be specified as 'T' or 'F'. !! !! __Revision history:__ -!! * 2019-06 - Stephan Frickenhaus, Lars Nerger - Initial code +!! * 2003-02 - Stephan Frickenhaus, Lars Nerger - Initial code !! * Later revisions - see repository log !! MODULE parser use mpi + USE mod_parallel_pdaf, & + ONLY: abort_parallel IMPLICIT NONE SAVE @@ -187,6 +189,8 @@ SUBROUTINE parse_string(handle, charvalue) ! *** local variables *** CHARACTER(len=100) :: string CHARACTER(len=100) :: parsed_string + CHARACTER(len=110) :: str1_check + CHARACTER(len=110) :: str2_check LOGICAL :: modified ! *** Initialize *** @@ -206,9 +210,27 @@ SUBROUTINE parse_string(handle, charvalue) DO i = 1, command_argument_count() - 1 CALL get_command_argument(i, str1) CALL get_command_argument(i+1, str2) + + ! Add check for inadmissible strings longer than 100 + ! characters + CALL get_command_argument(i, str1_check) + CALL get_command_argument(i+1, str2_check) + IF (mype == 0) THEN + IF (.NOT. TRIM(str2_check) == TRIM(str2)) THEN + WRITE (*,'(2x, a)') "PARSER: ERROR, command line input too long." + WRITE (*,'(2x, a, 1x, a)') "called handle=", TRIM(string) + WRITE (*,'(2x, a, 1x, a)') "parsed handle=", TRIM(str1) + WRITE (*,'(2x, a, 1x, a)') "parsed input(cut)=", TRIM(str2) + call abort_parallel() + END IF + END IF + + #endif IF (str1 == TRIM(string)) THEN - READ(str2, *) parsed_string + ! Format specifier is needed for reading paths. Using + ! `*` as format specifier, reading stops at a `/` + READ(str2, '(a)') parsed_string modified = .TRUE. END IF ENDDO diff --git a/tutorial/runtests.sh b/tutorial/runtests.sh index 8e9bc8db4..84113c847 100755 --- a/tutorial/runtests.sh +++ b/tutorial/runtests.sh @@ -7,6 +7,9 @@ export DA_SPECS2="-filtertype 6 -screen 1" export DA_SPECS3="-filtertype 7 screen 1 -assim_A .false. -assim_B .true" COMPILE=1 +RUN_OFFLINE=1 +RUN_ONLINE_SERIAL=1 +RUN_ONLINE_PARALLEL=1 echo "------------------ COMPILING ----------------" @@ -85,116 +88,132 @@ fi echo " " echo "-------------------- RUNNING ----------------" +#--------- OFFLINE ------------- -echo "------------ offline_2D_serial ---------------------------------------------" -export OMP_NUM_THREADS=1 -cd offline_2D_serial -make cleandataq -./PDAF_offline $DA_SPECS > ../out.offline_2D_serial -cd .. -python verification/check_offline.py offline_2D_serial - -echo "------------ offline_2D_serial ---------------------------------------------" -export OMP_NUM_THREADS=1 -cd offline_2D_serial -make cleandataq -./PDAF_offline $DA_SPECS2 > ../out.offline_2D_serial_ESTKF -cd .. -python verification/check_offline2.py offline_2D_serial offline_2D_serial_ESTKF - -echo "------------ offline_2D_openmp ---------------------------------------------" -export OMP_NUM_THREADS=4 -cd offline_2D_serial -make cleandataq -./PDAF_offline $DA_SPECS > ../out.offline_2D_openmp -cd .. -python verification/check_offline.py offline_2D_serial - -echo "------------ offline_2D_parallel -------------------------------------------" -export OMP_NUM_THREADS=1 -cd offline_2D_parallel -make cleandataq -mpirun -np 4 ./PDAF_offline $DA_SPECS > ../out.offline_2D_parallel -cd .. -python verification/check_offline.py offline_2D_parallel - -echo "------------ online_2D_serialmodel LESTKF ----------------------------------" -export OMP_NUM_THREADS=1 -cd online_2D_serialmodel -make cleandataq -mpirun --oversubscribe -np 9 ./model_pdaf -dim_ens 9 $DA_SPECS > ../out.online_2D_serialmodel -cd .. -python verification/check_online2.py online_2D_serialmodel online_2D_serialmodel - -echo "------------ online_2D_serialmodel_openmp LESTKF ---------------------------" -export OMP_NUM_THREADS=2 -cd online_2D_serialmodel -make cleandataq -mpirun --oversubscribe -np 9 ./model_pdaf -dim_ens 9 $DA_SPECS > ../out.online_2D_serialmodel_openmp -cd .. -python verification/check_online.py online_2D_serialmodel - -echo "------------ online_2D_serialmodel_2fields LESTKF --------------------------" -export OMP_NUM_THREADS=1 -cd online_2D_serialmodel_2fields -make cleandataq -mpirun --oversubscribe -np 9 ./model_pdaf -dim_ens 9 $DA_SPECS > ../out.online_2D_serialmodel_2fields -cd .. -python verification/check_online2.py online_2D_serialmodel_2fields online_2D_serialmodel - -echo "------------ online_2D_serialmodel_2fields LESTKF obs-type B ---------------" -export OMP_NUM_THREADS=1 -cd online_2D_serialmodel_2fields -make cleandataq -mpirun --oversubscribe -np 9 ./model_pdaf -dim_ens 9 $DA_SPECS3 > ../out.online_2D_serialmodel_2fields_obsB -cd .. -python verification/check_online3.py online_2D_serialmodel_2fields online_2D_serialmodel_2fields_obsB - -echo "------------ online_2D_parallelmodel LESTKF --------------------------------" -export OMP_NUM_THREADS=1 -cd online_2D_parallelmodel -make cleandataq -mpirun --oversubscribe -np 18 ./model_pdaf -dim_ens 9 $DA_SPECS > ../out.online_2D_parallelmodel -cd .. -python verification/check_online.py online_2D_parallelmodel - -echo "------------ online_2D_serialmodel ESTKF -----------------------------------" -export OMP_NUM_THREADS=1 -cd online_2D_serialmodel -make cleandataq -mpirun --oversubscribe -np 9 ./model_pdaf -dim_ens 9 $DA_SPECS2 > ../out.online_2D_serialmodel_ESTKF -cd .. -python verification/check_online2.py online_2D_serialmodel online_2D_serialmodel_ESTKF - -echo "------------ online_2D_serialmodel_2fields ESTKF ---------------------------" -export OMP_NUM_THREADS=1 -cd online_2D_serialmodel_2fields -make cleandataq -mpirun --oversubscribe -np 9 ./model_pdaf -dim_ens 9 $DA_SPECS2 > ../out.online_2D_serialmodel_2fields_ESTKF -cd .. -python verification/check_online2.py online_2D_serialmodel_2fields online_2D_serialmodel_ESTKF - -echo "------------ online_2D_parallelmodel ESTKF ---------------------------------" -export OMP_NUM_THREADS=1 -cd online_2D_parallelmodel -make cleandataq -mpirun --oversubscribe -np 18 ./model_pdaf -dim_ens 9 $DA_SPECS2 > ../out.online_2D_parallelmodel_ESTKF -cd .. -python verification/check_online2.py online_2D_parallelmodel online_2D_parallelmodel_ESTKF - - -echo "------------ online_2D_parallelmodel_fullpar LESTKF ------------------------" -export OMP_NUM_THREADS=1 -cd online_2D_parallelmodel_fullpar -make cleandataq -mpirun --oversubscribe -np 20 ./model_pdaf -dim_ens 9 $DA_SPECS > ../out.online_2D_parallelmodel_fullpar -cd .. -python verification/check_online.py online_2D_parallelmodel_fullpar - -echo "------------ online_2D_parallelmodel_fullpar_1fpe LESTKF -------------------" -export OMP_NUM_THREADS=1 -cd online_2D_parallelmodel_fullpar_1fpe -make cleandataq -mpirun --oversubscribe -np 19 ./model_pdaf -dim_ens 9 $DA_SPECS > ../out.online_2D_parallelmodel_fullpar_1fpe -cd .. -python verification/check_online.py online_2D_parallelmodel_fullpar_1fpe +if [ $RUN_OFFLINE -eq 1 ] +then + + echo "------------ offline_2D_serial ---------------------------------------------" + export OMP_NUM_THREADS=1 + cd offline_2D_serial + make cleandataq + ./PDAF_offline $DA_SPECS > ../out.offline_2D_serial + cd .. + python verification/check_offline.py offline_2D_serial + + echo "------------ offline_2D_serial ---------------------------------------------" + export OMP_NUM_THREADS=1 + cd offline_2D_serial + make cleandataq + ./PDAF_offline $DA_SPECS2 > ../out.offline_2D_serial_ESTKF + cd .. + python verification/check_offline2.py offline_2D_serial offline_2D_serial_ESTKF + + echo "------------ offline_2D_openmp ---------------------------------------------" + export OMP_NUM_THREADS=4 + cd offline_2D_serial + make cleandataq + ./PDAF_offline $DA_SPECS > ../out.offline_2D_openmp + cd .. + python verification/check_offline.py offline_2D_serial + + echo "------------ offline_2D_parallel -------------------------------------------" + export OMP_NUM_THREADS=1 + cd offline_2D_parallel + make cleandataq + mpirun -np 4 ./PDAF_offline $DA_SPECS > ../out.offline_2D_parallel + cd .. + python verification/check_offline.py offline_2D_parallel +fi + +#--------- ONLINE SERIAL ------------- + +if [ $RUN_ONLINE_SERIAL -eq 1 ] +then + + echo "------------ online_2D_serialmodel LESTKF ----------------------------------" + export OMP_NUM_THREADS=1 + cd online_2D_serialmodel + make cleandataq + mpirun --oversubscribe -np 9 ./model_pdaf -dim_ens 9 $DA_SPECS > ../out.online_2D_serialmodel + cd .. + python verification/check_online2.py online_2D_serialmodel online_2D_serialmodel + + echo "------------ online_2D_serialmodel_openmp LESTKF ---------------------------" + export OMP_NUM_THREADS=2 + cd online_2D_serialmodel + make cleandataq + mpirun --oversubscribe -np 9 ./model_pdaf -dim_ens 9 $DA_SPECS > ../out.online_2D_serialmodel_openmp + cd .. + python verification/check_online.py online_2D_serialmodel + + echo "------------ online_2D_serialmodel_2fields LESTKF --------------------------" + export OMP_NUM_THREADS=1 + cd online_2D_serialmodel_2fields + make cleandataq + mpirun --oversubscribe -np 9 ./model_pdaf -dim_ens 9 $DA_SPECS > ../out.online_2D_serialmodel_2fields + cd .. + python verification/check_online2.py online_2D_serialmodel_2fields online_2D_serialmodel + + echo "------------ online_2D_serialmodel_2fields LESTKF obs-type B ---------------" + export OMP_NUM_THREADS=1 + cd online_2D_serialmodel_2fields + make cleandataq + mpirun --oversubscribe -np 9 ./model_pdaf -dim_ens 9 $DA_SPECS3 > ../out.online_2D_serialmodel_2fields_obsB + cd .. + python verification/check_online3.py online_2D_serialmodel_2fields online_2D_serialmodel_2fields_obsB + + echo "------------ online_2D_serialmodel ESTKF -----------------------------------" + export OMP_NUM_THREADS=1 + cd online_2D_serialmodel + make cleandataq + mpirun --oversubscribe -np 9 ./model_pdaf -dim_ens 9 $DA_SPECS2 > ../out.online_2D_serialmodel_ESTKF + cd .. + python verification/check_online2.py online_2D_serialmodel online_2D_serialmodel_ESTKF + + echo "------------ online_2D_serialmodel_2fields ESTKF ---------------------------" + export OMP_NUM_THREADS=1 + cd online_2D_serialmodel_2fields + make cleandataq + mpirun --oversubscribe -np 9 ./model_pdaf -dim_ens 9 $DA_SPECS2 > ../out.online_2D_serialmodel_2fields_ESTKF + cd .. + python verification/check_online2.py online_2D_serialmodel_2fields online_2D_serialmodel_ESTKF +fi + +#--------- ONLINE PARALLEL ------------- + +if [ $RUN_ONLINE_PARALLEL -eq 1 ] +then + + echo "------------ online_2D_parallelmodel LESTKF --------------------------------" + export OMP_NUM_THREADS=1 + cd online_2D_parallelmodel + make cleandataq + mpirun --oversubscribe -np 18 ./model_pdaf -dim_ens 9 $DA_SPECS > ../out.online_2D_parallelmodel + cd .. + python verification/check_online.py online_2D_parallelmodel + + echo "------------ online_2D_parallelmodel ESTKF ---------------------------------" + export OMP_NUM_THREADS=1 + cd online_2D_parallelmodel + make cleandataq + mpirun --oversubscribe -np 18 ./model_pdaf -dim_ens 9 $DA_SPECS2 > ../out.online_2D_parallelmodel_ESTKF + cd .. + python verification/check_online2.py online_2D_parallelmodel online_2D_parallelmodel_ESTKF + + echo "------------ online_2D_parallelmodel_fullpar LESTKF ------------------------" + export OMP_NUM_THREADS=1 + cd online_2D_parallelmodel_fullpar + make cleandataq + mpirun --oversubscribe -np 20 ./model_pdaf -dim_ens 9 $DA_SPECS > ../out.online_2D_parallelmodel_fullpar + cd .. + python verification/check_online.py online_2D_parallelmodel_fullpar + + echo "------------ online_2D_parallelmodel_fullpar_1fpe LESTKF -------------------" + export OMP_NUM_THREADS=1 + cd online_2D_parallelmodel_fullpar_1fpe + make cleandataq + mpirun --oversubscribe -np 19 ./model_pdaf -dim_ens 9 $DA_SPECS > ../out.online_2D_parallelmodel_fullpar_1fpe + cd .. + python verification/check_online.py online_2D_parallelmodel_fullpar_1fpe +fi diff --git a/tutorial/verification/out.offline_2D_openmp b/tutorial/verification/out.offline_2D_openmp index 793ed0fa4..ea65e889a 100644 --- a/tutorial/verification/out.offline_2D_openmp +++ b/tutorial/verification/out.offline_2D_openmp @@ -35,7 +35,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -140,19 +140,17 @@ PDAF analysis step: 0.020 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- -PDAF Initialize PDAF: 0.003 s -PDAF init_ens_pdaf: 0.003 s -PDAF LESTKF analysis: 0.003 s +PDAF Initialize PDAF: 0.002 s +PDAF init_ens_pdaf: 0.002 s +PDAF LESTKF analysis: 0.002 s PDAF PDAF-internal operations: 0.000 s PDAF OMI-internal routines: 0.000 s PDAF init_n_domains_pdaf: 0.000 s PDAF init_dim_l_pdaf: 0.000 s -PDAF g2l_state_pdaf: 0.000 s -PDAF l2g_state_pdaf: 0.000 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.000 s +PDAF init_dim_obs_pdafomi: 0.001 s PDAF obs_op_pdafomi: 0.000 s -PDAF init_dim_obs_l_pdafomi: 0.003 s -PDAF prepoststep_pdaf: 0.006 s +PDAF init_dim_obs_l_pdafomi: 0.001 s +PDAF prepoststep_pdaf: 0.009 s PDAF offline mode: END diff --git a/tutorial/verification/out.offline_2D_parallel b/tutorial/verification/out.offline_2D_parallel index 2f2353cf8..fb8f408d3 100644 --- a/tutorial/verification/out.offline_2D_parallel +++ b/tutorial/verification/out.offline_2D_parallel @@ -44,7 +44,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -140,33 +140,31 @@ PDAF Forecast ------------------------------------------------------- model PE exited: mype 0 PDAF offline mode: EXITED ASSIMILATION - model PE exited: mype 1 - model PE exited: mype 2 - model PE exited: mype 3 PDAF PDAF Memory overview PDAF --------------------------------------------- -PDAF Globally allocated memory (MiB) -PDAF state and A: 0.012 MiB (persistent) -PDAF ensemble array: 0.044 MiB (persistent) -PDAF analysis step: 0.079 MiB (temporary) +PDAF Allocated memory (MiB) +PDAF state and A: 0.003 MiB (persistent) +PDAF ensemble array: 0.011 MiB (persistent) +PDAF analysis step: 0.020 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- -PDAF Initialize PDAF: 0.003 s -PDAF init_ens_pdaf: 0.003 s -PDAF LESTKF analysis: 0.099 s -PDAF PDAF-internal operations: 0.009 s +PDAF Initialize PDAF: 0.002 s +PDAF init_ens_pdaf: 0.002 s +PDAF LESTKF analysis: 0.110 s +PDAF PDAF-internal operations: 0.010 s PDAF OMI-internal routines: 0.000 s PDAF init_n_domains_pdaf: 0.000 s PDAF init_dim_l_pdaf: 0.000 s -PDAF g2l_state_pdaf: 0.000 s -PDAF l2g_state_pdaf: 0.000 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.027 s -PDAF obs_op_pdafomi: 0.068 s +PDAF init_dim_obs_pdafomi: 0.023 s +PDAF obs_op_pdafomi: 0.075 s PDAF init_dim_obs_l_pdafomi: 0.000 s -PDAF prepoststep_pdaf: 0.011 s +PDAF prepoststep_pdaf: 0.019 s PDAF offline mode: END + model PE exited: mype 2 + model PE exited: mype 3 + model PE exited: mype 1 diff --git a/tutorial/verification/out.offline_2D_serial b/tutorial/verification/out.offline_2D_serial index 913d1df09..43f8a8943 100644 --- a/tutorial/verification/out.offline_2D_serial +++ b/tutorial/verification/out.offline_2D_serial @@ -35,7 +35,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -140,19 +140,17 @@ PDAF analysis step: 0.020 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- -PDAF Initialize PDAF: 0.003 s -PDAF init_ens_pdaf: 0.003 s -PDAF LESTKF analysis: 0.003 s +PDAF Initialize PDAF: 0.002 s +PDAF init_ens_pdaf: 0.002 s +PDAF LESTKF analysis: 0.002 s PDAF PDAF-internal operations: 0.000 s PDAF OMI-internal routines: 0.000 s PDAF init_n_domains_pdaf: 0.000 s PDAF init_dim_l_pdaf: 0.000 s -PDAF g2l_state_pdaf: 0.001 s -PDAF l2g_state_pdaf: 0.001 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.000 s +PDAF init_dim_obs_pdafomi: 0.001 s PDAF obs_op_pdafomi: 0.000 s -PDAF init_dim_obs_l_pdafomi: 0.001 s -PDAF prepoststep_pdaf: 0.006 s +PDAF init_dim_obs_l_pdafomi: 0.000 s +PDAF prepoststep_pdaf: 0.010 s PDAF offline mode: END diff --git a/tutorial/verification/out.offline_2D_serial_3denvar_opt2 b/tutorial/verification/out.offline_2D_serial_3denvar_opt2 index c09481f41..471b5134f 100644 --- a/tutorial/verification/out.offline_2D_serial_3denvar_opt2 +++ b/tutorial/verification/out.offline_2D_serial_3denvar_opt2 @@ -34,7 +34,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -80,7 +80,7 @@ PDAF: Call routine for ensemble initialization Initialize B^1/2 for 3D-Var PDAF: Initialization completed -PDAF --- duration of PDAF initialization: 0.004 s +PDAF --- duration of PDAF initialization: 0.002 s PDAF Activate PDAF offline mode PDAF offline mode: START ASSIMILATION @@ -115,7 +115,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 4.406D+01 4.858D+00 8.5D-02 4.1D-02 - 2 5 3.635D+01 7.166D-09 6.5D-01 -4.8D-15 + 2 5 3.635D+01 7.166D-09 6.5D-01 -5.2D-15 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -124,13 +124,13 @@ PDAF Perform ensemble transformation PDAF --- use symmetric square-root of A PDAF --- Compute deterministic Omega PDAF --- Ensemble update: use blocking with size 200 -PDAF --- duration of En3D-Var update: 0.001 s +PDAF --- duration of En3D-Var update: 0.000 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 1.0503E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.008 s +PDAF --- duration of poststep: 0.007 s PDAF Forecast ------------------------------------------------------- model PE exited: mype 0 @@ -146,19 +146,19 @@ PDAF analysis step: 0.033 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- -PDAF Initialize PDAF: 0.004 s -PDAF init_ens_pdaf: 0.004 s -PDAF Hyb3DVAR analysis: 0.002 s -PDAF PDAF-internal operations: 0.001 s +PDAF Initialize PDAF: 0.002 s +PDAF init_ens_pdaf: 0.002 s +PDAF Hyb3DVAR analysis: 0.000 s +PDAF PDAF-internal operations: 0.000 s PDAF OMI-internal routines: 0.000 s PDAF Solver: 0.000 s PDAF cvt_ens_pdaf: 0.000 s PDAF cvt_ens_adj_pdaf: 0.000 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.000 s +PDAF init_dim_obs_pdafomi: 0.001 s PDAF obs_op_pdafomi: 0.000 s PDAF obs_op_lin_pdafomi: 0.000 s PDAF obs_op_adj_pdafomi: 0.000 s -PDAF prepoststep_pdaf: 0.008 s +PDAF prepoststep_pdaf: 0.007 s PDAF offline mode: END diff --git a/tutorial/verification/out.offline_2D_serial_3dhybvar_opt2 b/tutorial/verification/out.offline_2D_serial_3dhybvar_opt2 index 4c7675324..b12b01ee9 100644 --- a/tutorial/verification/out.offline_2D_serial_3dhybvar_opt2 +++ b/tutorial/verification/out.offline_2D_serial_3dhybvar_opt2 @@ -35,7 +35,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -83,7 +83,7 @@ PDAF: Call routine for ensemble initialization Initialize B^1/2 for 3D-Var PDAF: Initialization completed -PDAF --- duration of PDAF initialization: 0.002 s +PDAF --- duration of PDAF initialization: 0.004 s PDAF Activate PDAF offline mode PDAF offline mode: START ASSIMILATION @@ -119,7 +119,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 4.406D+01 4.858D+00 8.5D-02 4.1D-02 - 2 5 3.635D+01 7.166D-09 6.5D-01 -6.2D-15 + 2 5 3.635D+01 7.166D-09 6.5D-01 -6.1D-15 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -128,13 +128,13 @@ PDAF Perform ensemble transformation PDAF --- use symmetric square-root of A PDAF --- Compute deterministic Omega PDAF --- Ensemble update: use blocking with size 200 -PDAF --- duration of hyb3D-Var update: 0.000 s +PDAF --- duration of hyb3D-Var update: 0.001 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 1.0503E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.006 s +PDAF --- duration of poststep: 0.007 s PDAF Forecast ------------------------------------------------------- model PE exited: mype 0 @@ -150,19 +150,19 @@ PDAF analysis step: 0.038 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- -PDAF Initialize PDAF: 0.002 s -PDAF init_ens_pdaf: 0.002 s -PDAF Hyb3DVAR analysis: 0.000 s -PDAF PDAF-internal operations: 0.000 s +PDAF Initialize PDAF: 0.004 s +PDAF init_ens_pdaf: 0.003 s +PDAF Hyb3DVAR analysis: 0.002 s +PDAF PDAF-internal operations: 0.001 s PDAF OMI-internal routines: 0.000 s PDAF Solver: 0.000 s PDAF cvt_ens_pdaf: 0.000 s PDAF cvt_ens_adj_pdaf: 0.000 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.001 s +PDAF init_dim_obs_pdafomi: 0.000 s PDAF obs_op_pdafomi: 0.000 s PDAF obs_op_lin_pdafomi: 0.000 s PDAF obs_op_adj_pdafomi: 0.000 s -PDAF prepoststep_pdaf: 0.006 s +PDAF prepoststep_pdaf: 0.007 s PDAF offline mode: END diff --git a/tutorial/verification/out.offline_2D_serial_3dlenvar_opt2 b/tutorial/verification/out.offline_2D_serial_3dlenvar_opt2 index 24ace2dd2..513f7f690 100644 --- a/tutorial/verification/out.offline_2D_serial_3dlenvar_opt2 +++ b/tutorial/verification/out.offline_2D_serial_3dlenvar_opt2 @@ -34,7 +34,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -116,7 +116,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 4.406D+01 4.858D+00 8.5D-02 4.1D-02 - 2 5 3.635D+01 7.166D-09 6.5D-01 -5.2D-15 + 2 5 3.635D+01 7.166D-09 6.5D-01 -4.8D-15 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -177,8 +177,6 @@ PDAF cvt_ens_adj_pdaf: 0.000 s PDAF Timers in LESTKF only PDAF init_n_domains_pdaf: 0.000 s PDAF init_dim_l_pdaf: 0.000 s -PDAF g2l_state_pdaf: 0.000 s -PDAF l2g_state_pdaf: 0.000 s PDAF Time in OMI observation module routines PDAF init_dim_obs_pdafomi: 0.001 s PDAF obs_op_pdafomi: 0.000 s diff --git a/tutorial/verification/out.offline_2D_serial_3dlhybvar_opt2 b/tutorial/verification/out.offline_2D_serial_3dlhybvar_opt2 index 616e49a68..051c1169c 100644 --- a/tutorial/verification/out.offline_2D_serial_3dlhybvar_opt2 +++ b/tutorial/verification/out.offline_2D_serial_3dlhybvar_opt2 @@ -35,7 +35,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -83,7 +83,7 @@ PDAF: Call routine for ensemble initialization Initialize B^1/2 for 3D-Var PDAF: Initialization completed -PDAF --- duration of PDAF initialization: 0.002 s +PDAF --- duration of PDAF initialization: 0.003 s PDAF Activate PDAF offline mode PDAF offline mode: START ASSIMILATION @@ -169,25 +169,23 @@ PDAF analysis step: 0.036 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- -PDAF Initialize PDAF: 0.002 s +PDAF Initialize PDAF: 0.003 s PDAF init_ens_pdaf: 0.002 s PDAF Hyb3DVAR analysis: 0.004 s -PDAF PDAF-internal operations: 0.000 s -PDAF OMI-internal routines: 0.001 s -PDAF Solver: 0.001 s +PDAF PDAF-internal operations: 0.001 s +PDAF OMI-internal routines: 0.000 s +PDAF Solver: 0.000 s PDAF cvt_ens_pdaf: 0.000 s PDAF cvt_ens_adj_pdaf: 0.000 s PDAF Timers in LESTKF only PDAF init_n_domains_pdaf: 0.000 s PDAF init_dim_l_pdaf: 0.000 s -PDAF g2l_state_pdaf: 0.000 s -PDAF l2g_state_pdaf: 0.000 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.000 s +PDAF init_dim_obs_pdafomi: 0.001 s PDAF obs_op_pdafomi: 0.000 s PDAF obs_op_lin_pdafomi: 0.000 s PDAF obs_op_adj_pdafomi: 0.000 s -PDAF init_dim_obs_l_pdafomi: 0.002 s +PDAF init_dim_obs_l_pdafomi: 0.000 s PDAF prepoststep_pdaf: 0.007 s PDAF offline mode: END diff --git a/tutorial/verification/out.offline_2D_serial_3dv_opt1 b/tutorial/verification/out.offline_2D_serial_3dv_opt1 index b34800ba4..cf19f8c51 100644 --- a/tutorial/verification/out.offline_2D_serial_3dv_opt1 +++ b/tutorial/verification/out.offline_2D_serial_3dv_opt1 @@ -35,7 +35,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -81,7 +81,7 @@ PDAF: Call routine for ensemble initialization Initialize B^1/2 PDAF: Initialization completed -PDAF --- duration of PDAF initialization: 0.002 s +PDAF --- duration of PDAF initialization: 0.003 s PDAF Activate PDAF offline mode PDAF offline mode: START ASSIMILATION @@ -128,7 +128,7 @@ F = final function value CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL - Total User time 1.900E-04 seconds. + Total User time 2.880E-04 seconds. PDAF --- Exit optimization, status CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL PDAF --- update duration: 0.001 s @@ -136,7 +136,7 @@ PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 3.2465E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.002 s +PDAF --- duration of poststep: 0.001 s PDAF Forecast ------------------------------------------------------- model PE exited: mype 0 @@ -152,8 +152,8 @@ PDAF analysis step: 0.015 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- -PDAF Initialize PDAF: 0.002 s -PDAF init_ens_pdaf: 0.002 s +PDAF Initialize PDAF: 0.003 s +PDAF init_ens_pdaf: 0.003 s PDAF 3DVAR analysis: 0.001 s PDAF PDAF-internal operations: 0.000 s PDAF OMI-internal routines: 0.000 s @@ -165,6 +165,6 @@ PDAF init_dim_obs_pdafomi: 0.001 s PDAF obs_op_pdafomi: 0.000 s PDAF obs_op_lin_pdafomi: 0.000 s PDAF obs_op_adj_pdafomi: 0.000 s -PDAF prepoststep_pdaf: 0.002 s +PDAF prepoststep_pdaf: 0.001 s PDAF offline mode: END diff --git a/tutorial/verification/out.offline_2D_serial_3dv_opt2 b/tutorial/verification/out.offline_2D_serial_3dv_opt2 index dc458d0c6..ab0cbc176 100644 --- a/tutorial/verification/out.offline_2D_serial_3dv_opt2 +++ b/tutorial/verification/out.offline_2D_serial_3dv_opt2 @@ -35,7 +35,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -81,7 +81,7 @@ PDAF: Call routine for ensemble initialization Initialize B^1/2 PDAF: Initialization completed -PDAF --- duration of PDAF initialization: 0.002 s +PDAF --- duration of PDAF initialization: 0.003 s PDAF Activate PDAF offline mode PDAF offline mode: START ASSIMILATION @@ -118,12 +118,12 @@ INITIAL VALUES: SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 -PDAF --- update duration: 0.000 s +PDAF --- update duration: 0.001 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 3.2465E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.002 s +PDAF --- duration of poststep: 0.001 s PDAF Forecast ------------------------------------------------------- model PE exited: mype 0 @@ -139,19 +139,19 @@ PDAF analysis step: 0.011 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- -PDAF Initialize PDAF: 0.002 s +PDAF Initialize PDAF: 0.003 s PDAF init_ens_pdaf: 0.002 s -PDAF 3DVAR analysis: 0.000 s +PDAF 3DVAR analysis: 0.001 s PDAF PDAF-internal operations: 0.000 s PDAF OMI-internal routines: 0.000 s PDAF Solver: 0.000 s PDAF cvt_pdaf: 0.000 s PDAF cvt_adj_pdaf: 0.000 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.000 s +PDAF init_dim_obs_pdafomi: 0.001 s PDAF obs_op_pdafomi: 0.000 s PDAF obs_op_lin_pdafomi: 0.000 s PDAF obs_op_adj_pdafomi: 0.000 s -PDAF prepoststep_pdaf: 0.002 s +PDAF prepoststep_pdaf: 0.001 s PDAF offline mode: END diff --git a/tutorial/verification/out.offline_2D_serial_3dv_opt3 b/tutorial/verification/out.offline_2D_serial_3dv_opt3 index 1b1ff8a1b..25dac4b17 100644 --- a/tutorial/verification/out.offline_2D_serial_3dv_opt3 +++ b/tutorial/verification/out.offline_2D_serial_3dv_opt3 @@ -35,7 +35,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -107,7 +107,7 @@ PDAF --- CG solver converged PDAF iter eps F PDAF 4 0.000E+00 3.635E+01 -PDAF --- update duration: 0.001 s +PDAF --- update duration: 0.000 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 3.2465E-01 @@ -130,14 +130,14 @@ PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- PDAF Initialize PDAF: 0.003 s PDAF init_ens_pdaf: 0.003 s -PDAF 3DVAR analysis: 0.001 s +PDAF 3DVAR analysis: 0.000 s PDAF PDAF-internal operations: 0.000 s PDAF OMI-internal routines: 0.000 s PDAF Solver: 0.000 s PDAF cvt_pdaf: 0.000 s PDAF cvt_adj_pdaf: 0.000 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.001 s +PDAF init_dim_obs_pdafomi: 0.000 s PDAF obs_op_pdafomi: 0.000 s PDAF obs_op_lin_pdafomi: 0.000 s PDAF obs_op_adj_pdafomi: 0.000 s diff --git a/tutorial/verification/out.offline_2D_serial_ESTKF b/tutorial/verification/out.offline_2D_serial_ESTKF index ae126a40e..50caf020a 100644 --- a/tutorial/verification/out.offline_2D_serial_ESTKF +++ b/tutorial/verification/out.offline_2D_serial_ESTKF @@ -35,7 +35,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -126,12 +126,12 @@ PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- PDAF Initialize PDAF: 0.003 s PDAF init_ens_pdaf: 0.003 s -PDAF ESTKF analysis: 0.001 s -PDAF PDAF-internal operations: 0.001 s +PDAF ESTKF analysis: 0.000 s +PDAF PDAF-internal operations: 0.000 s PDAF OMI-internal routines: 0.000 s PDAF Time in OMI observation module routines PDAF init_dim_obs_pdafomi: 0.000 s PDAF obs_op_pdafomi: 0.000 s -PDAF prepoststep_pdaf: 0.008 s +PDAF prepoststep_pdaf: 0.010 s PDAF offline mode: END diff --git a/tutorial/verification/out.online_2D_parallelmodel b/tutorial/verification/out.online_2D_parallelmodel index 51d2f14c9..0bcc4fb8a 100644 --- a/tutorial/verification/out.online_2D_parallelmodel +++ b/tutorial/verification/out.online_2D_parallelmodel @@ -6,20 +6,20 @@ world filter model couple filterPE rank rank task rank task rank T/F ---------------------------------------------------------- - 13 7 1 2 6 F - 11 6 1 2 5 F 7 4 1 2 3 F - 15 8 1 2 7 F - 12 7 0 1 6 F - 10 6 0 1 5 F + 11 6 1 2 5 F + 13 7 1 2 6 F 6 4 0 1 3 F + 10 6 0 1 5 F + 12 7 0 1 6 F 9 5 1 2 4 F 5 3 1 2 2 F 3 2 1 2 1 F - 14 8 0 1 7 F + 15 8 1 2 7 F 8 5 0 1 4 F 4 3 0 1 2 F 2 2 0 1 1 F + 14 8 0 1 7 F 17 9 1 2 8 F 16 9 0 1 8 F 1 1 1 1 2 0 T @@ -53,7 +53,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -502,21 +502,19 @@ PDAF analysis step: 0.039 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- -PDAF Initialize PDAF: 0.036 s -PDAF init_ens_pdaf: 0.003 s -PDAF Ensemble forecast: 0.130 s -PDAF MPI communication in PDAF: 0.130 s +PDAF Initialize PDAF: 0.024 s +PDAF init_ens_pdaf: 0.004 s +PDAF Ensemble forecast: 0.183 s +PDAF MPI communication in PDAF: 0.183 s PDAF distribute_state_pdaf: 0.000 s PDAF collect_state_pdaf: 0.000 s -PDAF LESTKF analysis: 0.235 s -PDAF PDAF-internal operations: 0.023 s -PDAF OMI-internal routines: 0.017 s +PDAF LESTKF analysis: 0.846 s +PDAF PDAF-internal operations: 0.012 s +PDAF OMI-internal routines: 0.000 s PDAF init_n_domains_pdaf: 0.000 s -PDAF init_dim_l_pdaf: 0.000 s -PDAF g2l_state_pdaf: 0.003 s -PDAF l2g_state_pdaf: 0.001 s +PDAF init_dim_l_pdaf: 0.001 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.077 s -PDAF obs_op_pdafomi: 0.146 s -PDAF init_dim_obs_l_pdafomi: 0.006 s -PDAF prepoststep_pdaf: 0.253 s +PDAF init_dim_obs_pdafomi: 0.381 s +PDAF obs_op_pdafomi: 0.449 s +PDAF init_dim_obs_l_pdafomi: 0.000 s +PDAF prepoststep_pdaf: 0.220 s diff --git a/tutorial/verification/out.online_2D_parallelmodel_3denvar_opt12 b/tutorial/verification/out.online_2D_parallelmodel_3denvar_opt12 index dca40b294..680fd2a8e 100644 --- a/tutorial/verification/out.online_2D_parallelmodel_3denvar_opt12 +++ b/tutorial/verification/out.online_2D_parallelmodel_3denvar_opt12 @@ -6,12 +6,12 @@ world filter model couple filterPE rank rank task rank task rank T/F ---------------------------------------------------------- - 13 7 1 2 6 F 7 4 1 2 3 F 11 6 1 2 5 F + 13 7 1 2 6 F + 6 4 0 1 3 F 10 6 0 1 5 F 12 7 0 1 6 F - 6 4 0 1 3 F 9 5 1 2 4 F 5 3 1 2 2 F 3 2 1 2 1 F @@ -55,7 +55,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -100,7 +100,7 @@ PDAF: Call routine for ensemble initialization --- Ensemble size: 9 PDAF: Initialization completed -PDAF --- duration of PDAF initialization: 0.050 s +PDAF --- duration of PDAF initialization: 0.023 s PDAF ---------------------------------------------------------------- @@ -110,7 +110,7 @@ PDAF Call pre-post routine at initial time Analyze initial state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.7637E-01 -PDAF --- duration of prestep: 0.000 s +PDAF --- duration of prestep: 0.001 s PDAF Forecast ------------------------------------------------------- 0 Next observation at time step 2 PDAF Evolve state ensemble @@ -120,13 +120,13 @@ PDAF --- Distribute sub-ensembles step 2 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.032 s +PDAF --- duration of forecast phase: 0.016 s PDAF Call pre-post routine after forecast; step 2 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.014 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 2 Assimilating observations - ensemble 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -156,7 +156,7 @@ PDAF Perform ensemble transformation PDAF --- use symmetric square-root of A PDAF --- Compute deterministic Omega PDAF --- Ensemble update: use blocking with size 200 -PDAF --- duration of En3D-Var update: 0.007 s +PDAF --- duration of En3D-Var update: 0.003 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean @@ -171,13 +171,13 @@ PDAF --- Distribute sub-ensembles step 4 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.008 s +PDAF --- duration of forecast phase: 0.010 s PDAF Call pre-post routine after forecast; step 4 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 1.2745E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.012 s +PDAF --- duration of prestep: 0.022 s PDAF Analysis ------------------------------------------------------- PDAF 4 Assimilating observations - ensemble 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -213,7 +213,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 9.2179E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.013 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 4 Next observation at time step 6 PDAF Evolve state ensemble @@ -222,7 +222,7 @@ PDAF --- Distribute sub-ensembles step 6 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.023 s +PDAF --- duration of forecast phase: 0.015 s PDAF Call pre-post routine after forecast; step 6 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -258,13 +258,13 @@ PDAF Perform ensemble transformation PDAF --- use symmetric square-root of A PDAF --- Compute deterministic Omega PDAF --- Ensemble update: use blocking with size 200 -PDAF --- duration of En3D-Var update: 0.002 s +PDAF --- duration of En3D-Var update: 0.001 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 7.5872E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.014 s +PDAF --- duration of poststep: 0.013 s PDAF Forecast ------------------------------------------------------- 6 Next observation at time step 8 PDAF Evolve state ensemble @@ -273,7 +273,7 @@ PDAF --- Distribute sub-ensembles step 8 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.027 s +PDAF --- duration of forecast phase: 0.041 s PDAF Call pre-post routine after forecast; step 8 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -309,13 +309,13 @@ PDAF Perform ensemble transformation PDAF --- use symmetric square-root of A PDAF --- Compute deterministic Omega PDAF --- Ensemble update: use blocking with size 200 -PDAF --- duration of En3D-Var update: 0.003 s +PDAF --- duration of En3D-Var update: 0.001 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 6.5977E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.013 s +PDAF --- duration of poststep: 0.011 s PDAF Forecast ------------------------------------------------------- 8 Next observation at time step 10 PDAF Evolve state ensemble @@ -324,7 +324,7 @@ PDAF --- Distribute sub-ensembles step 10 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.024 s +PDAF --- duration of forecast phase: 0.011 s PDAF Call pre-post routine after forecast; step 10 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -359,13 +359,13 @@ PDAF Perform ensemble transformation PDAF --- use symmetric square-root of A PDAF --- Compute deterministic Omega PDAF --- Ensemble update: use blocking with size 200 -PDAF --- duration of En3D-Var update: 0.002 s +PDAF --- duration of En3D-Var update: 0.004 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.9158E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.013 s +PDAF --- duration of poststep: 0.015 s PDAF Forecast ------------------------------------------------------- 10 Next observation at time step 12 PDAF Evolve state ensemble @@ -380,7 +380,7 @@ PDAF Call pre-post routine after forecast; step 12 --- compute ensemble mean RMS error according to sampled variance: 5.9158E-02 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.011 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 12 Assimilating observations - ensemble 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -410,13 +410,13 @@ PDAF Perform ensemble transformation PDAF --- use symmetric square-root of A PDAF --- Compute deterministic Omega PDAF --- Ensemble update: use blocking with size 200 -PDAF --- duration of En3D-Var update: 0.001 s +PDAF --- duration of En3D-Var update: 0.004 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.4093E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.014 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 12 Next observation at time step 14 PDAF Evolve state ensemble @@ -425,13 +425,13 @@ PDAF --- Distribute sub-ensembles step 14 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.008 s +PDAF --- duration of forecast phase: 0.017 s PDAF Call pre-post routine after forecast; step 14 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.4093E-02 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.012 s +PDAF --- duration of prestep: 0.011 s PDAF Analysis ------------------------------------------------------- PDAF 14 Assimilating observations - ensemble 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -461,7 +461,7 @@ PDAF Perform ensemble transformation PDAF --- use symmetric square-root of A PDAF --- Compute deterministic Omega PDAF --- Ensemble update: use blocking with size 200 -PDAF --- duration of En3D-Var update: 0.001 s +PDAF --- duration of En3D-Var update: 0.002 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean @@ -476,13 +476,13 @@ PDAF --- Distribute sub-ensembles step 16 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.026 s +PDAF --- duration of forecast phase: 0.011 s PDAF Call pre-post routine after forecast; step 16 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.0140E-02 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.013 s +PDAF --- duration of prestep: 0.014 s PDAF Analysis ------------------------------------------------------- PDAF 16 Assimilating observations - ensemble 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -511,13 +511,13 @@ PDAF Perform ensemble transformation PDAF --- use symmetric square-root of A PDAF --- Compute deterministic Omega PDAF --- Ensemble update: use blocking with size 200 -PDAF --- duration of En3D-Var update: 0.001 s +PDAF --- duration of En3D-Var update: 0.005 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 4.6945E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.013 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 16 Next observation at time step 18 PDAF Evolve state ensemble @@ -526,13 +526,13 @@ PDAF --- Distribute sub-ensembles step 18 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.030 s +PDAF --- duration of forecast phase: 0.024 s PDAF Call pre-post routine after forecast; step 18 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 4.6945E-02 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.013 s +PDAF --- duration of prestep: 0.014 s PDAF Analysis ------------------------------------------------------- PDAF 18 Assimilating observations - ensemble 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -561,13 +561,13 @@ PDAF Perform ensemble transformation PDAF --- use symmetric square-root of A PDAF --- Compute deterministic Omega PDAF --- Ensemble update: use blocking with size 200 -PDAF --- duration of En3D-Var update: 0.017 s +PDAF --- duration of En3D-Var update: 0.006 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 4.4291E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.014 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 18 No more observations - end assimilation @@ -581,21 +581,21 @@ PDAF analysis step: 0.050 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- -PDAF Initialize PDAF: 0.050 s -PDAF init_ens_pdaf: 0.005 s -PDAF Ensemble forecast: 0.191 s -PDAF MPI communication in PDAF: 0.191 s +PDAF Initialize PDAF: 0.023 s +PDAF init_ens_pdaf: 0.003 s +PDAF Ensemble forecast: 0.158 s +PDAF MPI communication in PDAF: 0.158 s PDAF distribute_state_pdaf: 0.000 s PDAF collect_state_pdaf: 0.000 s -PDAF Hyb3DVAR analysis: 0.070 s -PDAF PDAF-internal operations: 0.108 s -PDAF OMI-internal routines: 0.276 s -PDAF Solver: 0.104 s -PDAF cvt_ens_pdaf: 0.044 s -PDAF cvt_ens_adj_pdaf: 0.031 s +PDAF Hyb3DVAR analysis: 0.054 s +PDAF PDAF-internal operations: 0.251 s +PDAF OMI-internal routines: 0.000 s +PDAF Solver: 0.217 s +PDAF cvt_ens_pdaf: 0.113 s +PDAF cvt_ens_adj_pdaf: 0.113 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.049 s +PDAF init_dim_obs_pdafomi: 0.149 s PDAF obs_op_pdafomi: 0.000 s PDAF obs_op_lin_pdafomi: 0.000 s PDAF obs_op_adj_pdafomi: 0.000 s -PDAF prepoststep_pdaf: 0.231 s +PDAF prepoststep_pdaf: 0.235 s diff --git a/tutorial/verification/out.online_2D_parallelmodel_3denvar_opt13 b/tutorial/verification/out.online_2D_parallelmodel_3denvar_opt13 index de070b7e1..d47b169f1 100644 --- a/tutorial/verification/out.online_2D_parallelmodel_3denvar_opt13 +++ b/tutorial/verification/out.online_2D_parallelmodel_3denvar_opt13 @@ -55,7 +55,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -100,7 +100,7 @@ PDAF: Call routine for ensemble initialization --- Ensemble size: 9 PDAF: Initialization completed -PDAF --- duration of PDAF initialization: 0.024 s +PDAF --- duration of PDAF initialization: 0.023 s PDAF ---------------------------------------------------------------- @@ -120,13 +120,13 @@ PDAF --- Distribute sub-ensembles step 2 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.019 s +PDAF --- duration of forecast phase: 0.017 s PDAF Call pre-post routine after forecast; step 2 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.013 s +PDAF --- duration of prestep: 0.011 s PDAF Analysis ------------------------------------------------------- PDAF 2 Assimilating observations - ensemble 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -145,13 +145,13 @@ PDAF Perform ensemble transformation PDAF --- use symmetric square-root of A PDAF --- Compute deterministic Omega PDAF --- Ensemble update: use blocking with size 200 -PDAF --- duration of En3D-Var update: 0.002 s +PDAF --- duration of En3D-Var update: 0.001 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 1.2745E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.016 s +PDAF --- duration of poststep: 0.015 s PDAF Forecast ------------------------------------------------------- 2 Next observation at time step 4 PDAF Evolve state ensemble @@ -160,13 +160,13 @@ PDAF --- Distribute sub-ensembles step 4 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.006 s +PDAF --- duration of forecast phase: 0.008 s PDAF Call pre-post routine after forecast; step 4 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 1.2745E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.012 s +PDAF --- duration of prestep: 0.013 s PDAF Analysis ------------------------------------------------------- PDAF 4 Assimilating observations - ensemble 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -191,7 +191,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 9.2179E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.013 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 4 Next observation at time step 6 PDAF Evolve state ensemble @@ -200,13 +200,13 @@ PDAF --- Distribute sub-ensembles step 6 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.024 s +PDAF --- duration of forecast phase: 0.028 s PDAF Call pre-post routine after forecast; step 6 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 9.2179E-02 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.011 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 6 Assimilating observations - ensemble 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -225,7 +225,7 @@ PDAF Perform ensemble transformation PDAF --- use symmetric square-root of A PDAF --- Compute deterministic Omega PDAF --- Ensemble update: use blocking with size 200 -PDAF --- duration of En3D-Var update: 0.001 s +PDAF --- duration of En3D-Var update: 0.003 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean @@ -240,7 +240,7 @@ PDAF --- Distribute sub-ensembles step 8 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.017 s +PDAF --- duration of forecast phase: 0.019 s PDAF Call pre-post routine after forecast; step 8 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -265,13 +265,13 @@ PDAF Perform ensemble transformation PDAF --- use symmetric square-root of A PDAF --- Compute deterministic Omega PDAF --- Ensemble update: use blocking with size 200 -PDAF --- duration of En3D-Var update: 0.001 s +PDAF --- duration of En3D-Var update: 0.006 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 6.5977E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.023 s +PDAF --- duration of poststep: 0.013 s PDAF Forecast ------------------------------------------------------- 8 Next observation at time step 10 PDAF Evolve state ensemble @@ -280,7 +280,7 @@ PDAF --- Distribute sub-ensembles step 10 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.009 s PDAF Call pre-post routine after forecast; step 10 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -305,7 +305,7 @@ PDAF Perform ensemble transformation PDAF --- use symmetric square-root of A PDAF --- Compute deterministic Omega PDAF --- Ensemble update: use blocking with size 200 -PDAF --- duration of En3D-Var update: 0.001 s +PDAF --- duration of En3D-Var update: 0.011 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean @@ -320,13 +320,13 @@ PDAF --- Distribute sub-ensembles step 12 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.012 s +PDAF --- duration of forecast phase: 0.015 s PDAF Call pre-post routine after forecast; step 12 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.9158E-02 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.012 s +PDAF --- duration of prestep: 0.013 s PDAF Analysis ------------------------------------------------------- PDAF 12 Assimilating observations - ensemble 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -345,13 +345,13 @@ PDAF Perform ensemble transformation PDAF --- use symmetric square-root of A PDAF --- Compute deterministic Omega PDAF --- Ensemble update: use blocking with size 200 -PDAF --- duration of En3D-Var update: 0.001 s +PDAF --- duration of En3D-Var update: 0.006 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.4093E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.025 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 12 Next observation at time step 14 PDAF Evolve state ensemble @@ -360,13 +360,13 @@ PDAF --- Distribute sub-ensembles step 14 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.011 s PDAF Call pre-post routine after forecast; step 14 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.4093E-02 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.013 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 14 Assimilating observations - ensemble 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -385,7 +385,7 @@ PDAF Perform ensemble transformation PDAF --- use symmetric square-root of A PDAF --- Compute deterministic Omega PDAF --- Ensemble update: use blocking with size 200 -PDAF --- duration of En3D-Var update: 0.002 s +PDAF --- duration of En3D-Var update: 0.007 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean @@ -400,13 +400,13 @@ PDAF --- Distribute sub-ensembles step 16 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.016 s PDAF Call pre-post routine after forecast; step 16 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.0140E-02 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.030 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 16 Assimilating observations - ensemble 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -425,7 +425,7 @@ PDAF Perform ensemble transformation PDAF --- use symmetric square-root of A PDAF --- Compute deterministic Omega PDAF --- Ensemble update: use blocking with size 200 -PDAF --- duration of En3D-Var update: 0.001 s +PDAF --- duration of En3D-Var update: 0.005 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean @@ -440,13 +440,13 @@ PDAF --- Distribute sub-ensembles step 18 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.024 s +PDAF --- duration of forecast phase: 0.020 s PDAF Call pre-post routine after forecast; step 18 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 4.6945E-02 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.016 s +PDAF --- duration of prestep: 0.014 s PDAF Analysis ------------------------------------------------------- PDAF 18 Assimilating observations - ensemble 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -465,13 +465,13 @@ PDAF Perform ensemble transformation PDAF --- use symmetric square-root of A PDAF --- Compute deterministic Omega PDAF --- Ensemble update: use blocking with size 200 -PDAF --- duration of En3D-Var update: 0.002 s +PDAF --- duration of En3D-Var update: 0.006 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 4.4291E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.015 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 18 No more observations - end assimilation @@ -485,21 +485,21 @@ PDAF analysis step: 0.051 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- -PDAF Initialize PDAF: 0.024 s -PDAF init_ens_pdaf: 0.004 s -PDAF Ensemble forecast: 0.123 s -PDAF MPI communication in PDAF: 0.123 s +PDAF Initialize PDAF: 0.023 s +PDAF init_ens_pdaf: 0.003 s +PDAF Ensemble forecast: 0.143 s +PDAF MPI communication in PDAF: 0.142 s PDAF distribute_state_pdaf: 0.000 s PDAF collect_state_pdaf: 0.000 s -PDAF Hyb3DVAR analysis: 0.024 s -PDAF PDAF-internal operations: 0.043 s -PDAF OMI-internal routines: 0.154 s -PDAF Solver: 0.022 s -PDAF cvt_ens_pdaf: 0.047 s -PDAF cvt_ens_adj_pdaf: 0.040 s +PDAF Hyb3DVAR analysis: 0.092 s +PDAF PDAF-internal operations: 0.242 s +PDAF OMI-internal routines: 0.000 s +PDAF Solver: 0.093 s +PDAF cvt_ens_pdaf: 0.165 s +PDAF cvt_ens_adj_pdaf: 0.138 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.029 s +PDAF init_dim_obs_pdafomi: 0.089 s PDAF obs_op_pdafomi: 0.000 s -PDAF obs_op_lin_pdafomi: 0.000 s +PDAF obs_op_lin_pdafomi: 0.001 s PDAF obs_op_adj_pdafomi: 0.000 s -PDAF prepoststep_pdaf: 0.274 s +PDAF prepoststep_pdaf: 0.226 s diff --git a/tutorial/verification/out.online_2D_parallelmodel_3dhybvar_opt12 b/tutorial/verification/out.online_2D_parallelmodel_3dhybvar_opt12 index 01e05e033..d05531bdf 100644 --- a/tutorial/verification/out.online_2D_parallelmodel_3dhybvar_opt12 +++ b/tutorial/verification/out.online_2D_parallelmodel_3dhybvar_opt12 @@ -60,7 +60,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -109,7 +109,7 @@ PDAF: Call routine for ensemble initialization Initialize B^1/2 for 3D-Var PDAF: Initialization completed -PDAF --- duration of PDAF initialization: 0.031 s +PDAF --- duration of PDAF initialization: 0.022 s PDAF ---------------------------------------------------------------- @@ -135,7 +135,7 @@ PDAF Call pre-post routine after forecast; step 2 --- compute ensemble mean RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.011 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 2 Assimilating observations - hybrid 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -172,7 +172,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 1.2745E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.016 s +PDAF --- duration of poststep: 0.015 s PDAF Forecast ------------------------------------------------------- 2 Next observation at time step 4 PDAF Evolve state ensemble @@ -181,13 +181,13 @@ PDAF --- Distribute sub-ensembles step 4 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.008 s +PDAF --- duration of forecast phase: 0.009 s PDAF Call pre-post routine after forecast; step 4 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 1.2745E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.011 s +PDAF --- duration of prestep: 0.013 s PDAF Analysis ------------------------------------------------------- PDAF 4 Assimilating observations - hybrid 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -233,7 +233,7 @@ PDAF --- Distribute sub-ensembles step 6 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.008 s +PDAF --- duration of forecast phase: 0.036 s PDAF Call pre-post routine after forecast; step 6 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -270,13 +270,13 @@ PDAF Perform ensemble transformation PDAF --- use symmetric square-root of A PDAF --- Compute deterministic Omega PDAF --- Ensemble update: use blocking with size 200 -PDAF --- duration of hyb3D-Var update: 0.001 s +PDAF --- duration of hyb3D-Var update: 0.002 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 7.5872E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.012 s +PDAF --- duration of poststep: 0.013 s PDAF Forecast ------------------------------------------------------- 6 Next observation at time step 8 PDAF Evolve state ensemble @@ -285,7 +285,7 @@ PDAF --- Distribute sub-ensembles step 8 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.022 s +PDAF --- duration of forecast phase: 0.010 s PDAF Call pre-post routine after forecast; step 8 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -328,7 +328,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 6.5977E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.011 s +PDAF --- duration of poststep: 0.014 s PDAF Forecast ------------------------------------------------------- 8 Next observation at time step 10 PDAF Evolve state ensemble @@ -337,13 +337,13 @@ PDAF --- Distribute sub-ensembles step 10 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.008 s +PDAF --- duration of forecast phase: 0.009 s PDAF Call pre-post routine after forecast; step 10 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 6.5977E-02 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.020 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 10 Assimilating observations - hybrid 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -389,13 +389,13 @@ PDAF --- Distribute sub-ensembles step 12 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.019 s +PDAF --- duration of forecast phase: 0.043 s PDAF Call pre-post routine after forecast; step 12 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.9158E-02 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.011 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 12 Assimilating observations - hybrid 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -441,13 +441,13 @@ PDAF --- Distribute sub-ensembles step 14 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.009 s PDAF Call pre-post routine after forecast; step 14 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.4093E-02 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.012 s +PDAF --- duration of prestep: 0.013 s PDAF Analysis ------------------------------------------------------- PDAF 14 Assimilating observations - hybrid 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -478,13 +478,13 @@ PDAF Perform ensemble transformation PDAF --- use symmetric square-root of A PDAF --- Compute deterministic Omega PDAF --- Ensemble update: use blocking with size 200 -PDAF --- duration of hyb3D-Var update: 0.001 s +PDAF --- duration of hyb3D-Var update: 0.002 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.0140E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.030 s +PDAF --- duration of poststep: 0.013 s PDAF Forecast ------------------------------------------------------- 14 Next observation at time step 16 PDAF Evolve state ensemble @@ -493,13 +493,13 @@ PDAF --- Distribute sub-ensembles step 16 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.009 s PDAF Call pre-post routine after forecast; step 16 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.0140E-02 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.011 s +PDAF --- duration of prestep: 0.013 s PDAF Analysis ------------------------------------------------------- PDAF 16 Assimilating observations - hybrid 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -521,7 +521,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 1.752D+01 9.468D-01 7.4D-02 1.8D-01 - 2 5 1.743D+01 1.416D-08 2.0D-01 -6.9D-15 + 2 5 1.743D+01 1.416D-08 2.0D-01 -6.6D-15 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -530,13 +530,13 @@ PDAF Perform ensemble transformation PDAF --- use symmetric square-root of A PDAF --- Compute deterministic Omega PDAF --- Ensemble update: use blocking with size 200 -PDAF --- duration of hyb3D-Var update: 0.001 s +PDAF --- duration of hyb3D-Var update: 0.002 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 4.6945E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.012 s +PDAF --- duration of poststep: 0.013 s PDAF Forecast ------------------------------------------------------- 16 Next observation at time step 18 PDAF Evolve state ensemble @@ -545,7 +545,7 @@ PDAF --- Distribute sub-ensembles step 18 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.027 s +PDAF --- duration of forecast phase: 0.021 s PDAF Call pre-post routine after forecast; step 18 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -573,7 +573,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 2.269D+01 1.641D+00 7.4D-02 1.8D-01 - 2 5 2.241D+01 2.208D-08 2.0D-01 -1.4D-15 + 2 5 2.241D+01 2.208D-08 2.0D-01 -8.9D-16 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -588,7 +588,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 4.4291E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.011 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 18 No more observations - end assimilation @@ -602,21 +602,21 @@ PDAF analysis step: 0.056 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- -PDAF Initialize PDAF: 0.031 s -PDAF init_ens_pdaf: 0.005 s -PDAF Ensemble forecast: 0.124 s -PDAF MPI communication in PDAF: 0.124 s +PDAF Initialize PDAF: 0.022 s +PDAF init_ens_pdaf: 0.004 s +PDAF Ensemble forecast: 0.164 s +PDAF MPI communication in PDAF: 0.164 s PDAF distribute_state_pdaf: 0.000 s PDAF collect_state_pdaf: 0.000 s -PDAF Hyb3DVAR analysis: 0.021 s -PDAF PDAF-internal operations: 0.071 s -PDAF OMI-internal routines: 0.300 s -PDAF Solver: 0.096 s -PDAF cvt_ens_pdaf: 0.048 s -PDAF cvt_ens_adj_pdaf: 0.021 s +PDAF Hyb3DVAR analysis: 0.028 s +PDAF PDAF-internal operations: 0.196 s +PDAF OMI-internal routines: 0.000 s +PDAF Solver: 0.177 s +PDAF cvt_ens_pdaf: 0.135 s +PDAF cvt_ens_adj_pdaf: 0.097 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.041 s -PDAF obs_op_pdafomi: 0.001 s -PDAF obs_op_lin_pdafomi: 0.000 s +PDAF init_dim_obs_pdafomi: 0.143 s +PDAF obs_op_pdafomi: 0.000 s +PDAF obs_op_lin_pdafomi: 0.001 s PDAF obs_op_adj_pdafomi: 0.000 s -PDAF prepoststep_pdaf: 0.242 s +PDAF prepoststep_pdaf: 0.229 s diff --git a/tutorial/verification/out.online_2D_parallelmodel_3dhybvar_opt13 b/tutorial/verification/out.online_2D_parallelmodel_3dhybvar_opt13 index e0e4822ac..ca168eb09 100644 --- a/tutorial/verification/out.online_2D_parallelmodel_3dhybvar_opt13 +++ b/tutorial/verification/out.online_2D_parallelmodel_3dhybvar_opt13 @@ -60,7 +60,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -109,7 +109,7 @@ PDAF: Call routine for ensemble initialization Initialize B^1/2 for 3D-Var PDAF: Initialization completed -PDAF --- duration of PDAF initialization: 0.025 s +PDAF --- duration of PDAF initialization: 0.023 s PDAF ---------------------------------------------------------------- @@ -119,7 +119,7 @@ PDAF Call pre-post routine at initial time Analyze initial state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.7637E-01 -PDAF --- duration of prestep: 0.001 s +PDAF --- duration of prestep: 0.000 s PDAF Forecast ------------------------------------------------------- 0 Next observation at time step 2 PDAF Evolve state ensemble @@ -129,13 +129,13 @@ PDAF --- Distribute sub-ensembles step 2 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.020 s +PDAF --- duration of forecast phase: 0.017 s PDAF Call pre-post routine after forecast; step 2 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.014 s +PDAF --- duration of prestep: 0.013 s PDAF Analysis ------------------------------------------------------- PDAF 2 Assimilating observations - hybrid 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -161,7 +161,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 1.2745E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.018 s +PDAF --- duration of poststep: 0.015 s PDAF Forecast ------------------------------------------------------- 2 Next observation at time step 4 PDAF Evolve state ensemble @@ -170,13 +170,13 @@ PDAF --- Distribute sub-ensembles step 4 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.009 s PDAF Call pre-post routine after forecast; step 4 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 1.2745E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.012 s +PDAF --- duration of prestep: 0.013 s PDAF Analysis ------------------------------------------------------- PDAF 4 Assimilating observations - hybrid 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -202,7 +202,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 9.2179E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.014 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 4 Next observation at time step 6 PDAF Evolve state ensemble @@ -211,7 +211,7 @@ PDAF --- Distribute sub-ensembles step 6 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.022 s +PDAF --- duration of forecast phase: 0.041 s PDAF Call pre-post routine after forecast; step 6 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -243,7 +243,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 7.5872E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.014 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 6 Next observation at time step 8 PDAF Evolve state ensemble @@ -252,13 +252,13 @@ PDAF --- Distribute sub-ensembles step 8 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.008 s +PDAF --- duration of forecast phase: 0.026 s PDAF Call pre-post routine after forecast; step 8 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 7.5872E-02 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.015 s +PDAF --- duration of prestep: 0.013 s PDAF Analysis ------------------------------------------------------- PDAF 8 Assimilating observations - hybrid 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -278,13 +278,13 @@ PDAF Perform ensemble transformation PDAF --- use symmetric square-root of A PDAF --- Compute deterministic Omega PDAF --- Ensemble update: use blocking with size 200 -PDAF --- duration of hyb3D-Var update: 0.001 s +PDAF --- duration of hyb3D-Var update: 0.003 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 6.5977E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.017 s +PDAF --- duration of poststep: 0.013 s PDAF Forecast ------------------------------------------------------- 8 Next observation at time step 10 PDAF Evolve state ensemble @@ -293,13 +293,13 @@ PDAF --- Distribute sub-ensembles step 10 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.014 s +PDAF --- duration of forecast phase: 0.008 s PDAF Call pre-post routine after forecast; step 10 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 6.5977E-02 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.015 s +PDAF --- duration of prestep: 0.013 s PDAF Analysis ------------------------------------------------------- PDAF 10 Assimilating observations - hybrid 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -325,7 +325,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 5.9158E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.015 s +PDAF --- duration of poststep: 0.013 s PDAF Forecast ------------------------------------------------------- 10 Next observation at time step 12 PDAF Evolve state ensemble @@ -334,13 +334,13 @@ PDAF --- Distribute sub-ensembles step 12 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.023 s +PDAF --- duration of forecast phase: 0.012 s PDAF Call pre-post routine after forecast; step 12 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.9158E-02 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.013 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 12 Assimilating observations - hybrid 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -360,7 +360,7 @@ PDAF Perform ensemble transformation PDAF --- use symmetric square-root of A PDAF --- Compute deterministic Omega PDAF --- Ensemble update: use blocking with size 200 -PDAF --- duration of hyb3D-Var update: 0.002 s +PDAF --- duration of hyb3D-Var update: 0.001 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean @@ -375,13 +375,13 @@ PDAF --- Distribute sub-ensembles step 14 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.041 s PDAF Call pre-post routine after forecast; step 14 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.4093E-02 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.026 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 14 Assimilating observations - hybrid 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -407,7 +407,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 5.0140E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.022 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 14 Next observation at time step 16 PDAF Evolve state ensemble @@ -416,13 +416,13 @@ PDAF --- Distribute sub-ensembles step 16 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.008 s +PDAF --- duration of forecast phase: 0.013 s PDAF Call pre-post routine after forecast; step 16 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.0140E-02 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.013 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 16 Assimilating observations - hybrid 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -448,7 +448,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 4.6945E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.014 s +PDAF --- duration of poststep: 0.013 s PDAF Forecast ------------------------------------------------------- 16 Next observation at time step 18 PDAF Evolve state ensemble @@ -457,13 +457,13 @@ PDAF --- Distribute sub-ensembles step 18 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.023 s +PDAF --- duration of forecast phase: 0.021 s PDAF Call pre-post routine after forecast; step 18 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 4.6945E-02 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.016 s +PDAF --- duration of prestep: 0.015 s PDAF Analysis ------------------------------------------------------- PDAF 18 Assimilating observations - hybrid 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -489,7 +489,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 4.4291E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.014 s +PDAF --- duration of poststep: 0.013 s PDAF Forecast ------------------------------------------------------- 18 No more observations - end assimilation @@ -503,21 +503,21 @@ PDAF analysis step: 0.056 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- -PDAF Initialize PDAF: 0.025 s -PDAF init_ens_pdaf: 0.003 s -PDAF Ensemble forecast: 0.132 s -PDAF MPI communication in PDAF: 0.131 s +PDAF Initialize PDAF: 0.023 s +PDAF init_ens_pdaf: 0.004 s +PDAF Ensemble forecast: 0.188 s +PDAF MPI communication in PDAF: 0.188 s PDAF distribute_state_pdaf: 0.000 s PDAF collect_state_pdaf: 0.000 s -PDAF Hyb3DVAR analysis: 0.022 s -PDAF PDAF-internal operations: 0.049 s -PDAF OMI-internal routines: 0.313 s -PDAF Solver: 0.039 s -PDAF cvt_ens_pdaf: 0.084 s -PDAF cvt_ens_adj_pdaf: 0.038 s +PDAF Hyb3DVAR analysis: 0.024 s +PDAF PDAF-internal operations: 0.153 s +PDAF OMI-internal routines: 0.000 s +PDAF Solver: 0.082 s +PDAF cvt_ens_pdaf: 0.146 s +PDAF cvt_ens_adj_pdaf: 0.079 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.032 s +PDAF init_dim_obs_pdafomi: 0.167 s PDAF obs_op_pdafomi: 0.000 s -PDAF obs_op_lin_pdafomi: 0.002 s +PDAF obs_op_lin_pdafomi: 0.001 s PDAF obs_op_adj_pdafomi: 0.000 s -PDAF prepoststep_pdaf: 0.278 s +PDAF prepoststep_pdaf: 0.231 s diff --git a/tutorial/verification/out.online_2D_parallelmodel_3dlenvar_opt12 b/tutorial/verification/out.online_2D_parallelmodel_3dlenvar_opt12 index 53bf38827..f32801bff 100644 --- a/tutorial/verification/out.online_2D_parallelmodel_3dlenvar_opt12 +++ b/tutorial/verification/out.online_2D_parallelmodel_3dlenvar_opt12 @@ -55,7 +55,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -101,7 +101,7 @@ PDAF: Call routine for ensemble initialization --- Ensemble size: 9 PDAF: Initialization completed -PDAF --- duration of PDAF initialization: 0.025 s +PDAF --- duration of PDAF initialization: 0.022 s PDAF ---------------------------------------------------------------- @@ -121,13 +121,13 @@ PDAF --- Distribute sub-ensembles step 2 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.036 s +PDAF --- duration of forecast phase: 0.021 s PDAF Call pre-post routine after forecast; step 2 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.012 s +PDAF --- duration of prestep: 0.011 s PDAF Analysis ------------------------------------------------------- PDAF 2 Assimilating observations - ensemble 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -175,13 +175,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.055 s +PDAF --- duration of En3D-Var update: 0.042 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.6883E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.012 s +PDAF --- duration of poststep: 0.011 s PDAF Forecast ------------------------------------------------------- 2 Next observation at time step 4 PDAF Evolve state ensemble @@ -190,13 +190,13 @@ PDAF --- Distribute sub-ensembles step 4 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.017 s +PDAF --- duration of forecast phase: 0.009 s PDAF Call pre-post routine after forecast; step 4 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.6883E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.010 s +PDAF --- duration of prestep: 0.011 s PDAF Analysis ------------------------------------------------------- PDAF 4 Assimilating observations - ensemble 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -244,13 +244,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.021 s +PDAF --- duration of En3D-Var update: 0.018 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.6119E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.011 s +PDAF --- duration of poststep: 0.010 s PDAF Forecast ------------------------------------------------------- 4 Next observation at time step 6 PDAF Evolve state ensemble @@ -259,13 +259,13 @@ PDAF --- Distribute sub-ensembles step 6 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.019 s +PDAF --- duration of forecast phase: 0.042 s PDAF Call pre-post routine after forecast; step 6 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.6119E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.010 s +PDAF --- duration of prestep: 0.011 s PDAF Analysis ------------------------------------------------------- PDAF 6 Assimilating observations - ensemble 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -313,13 +313,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.035 s +PDAF --- duration of En3D-Var update: 0.017 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5793E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.010 s +PDAF --- duration of poststep: 0.011 s PDAF Forecast ------------------------------------------------------- 6 Next observation at time step 8 PDAF Evolve state ensemble @@ -328,7 +328,7 @@ PDAF --- Distribute sub-ensembles step 8 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.008 s +PDAF --- duration of forecast phase: 0.035 s PDAF Call pre-post routine after forecast; step 8 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -382,13 +382,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.017 s +PDAF --- duration of En3D-Var update: 0.019 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5609E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.012 s +PDAF --- duration of poststep: 0.010 s PDAF Forecast ------------------------------------------------------- 8 Next observation at time step 10 PDAF Evolve state ensemble @@ -403,7 +403,7 @@ PDAF Call pre-post routine after forecast; step 10 --- compute ensemble mean RMS error according to sampled variance: 5.5609E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.010 s +PDAF --- duration of prestep: 0.011 s PDAF Analysis ------------------------------------------------------- PDAF 10 Assimilating observations - ensemble 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -451,13 +451,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.034 s +PDAF --- duration of En3D-Var update: 0.019 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5473E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.010 s +PDAF --- duration of poststep: 0.011 s PDAF Forecast ------------------------------------------------------- 10 Next observation at time step 12 PDAF Evolve state ensemble @@ -466,7 +466,7 @@ PDAF --- Distribute sub-ensembles step 12 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.023 s +PDAF --- duration of forecast phase: 0.037 s PDAF Call pre-post routine after forecast; step 12 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -520,7 +520,7 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.035 s +PDAF --- duration of En3D-Var update: 0.018 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean @@ -535,13 +535,13 @@ PDAF --- Distribute sub-ensembles step 14 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.008 s +PDAF --- duration of forecast phase: 0.013 s PDAF Call pre-post routine after forecast; step 14 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5387E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.027 s +PDAF --- duration of prestep: 0.011 s PDAF Analysis ------------------------------------------------------- PDAF 14 Assimilating observations - ensemble 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -589,13 +589,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.034 s +PDAF --- duration of En3D-Var update: 0.022 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5309E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.011 s +PDAF --- duration of poststep: 0.010 s PDAF Forecast ------------------------------------------------------- 14 Next observation at time step 16 PDAF Evolve state ensemble @@ -604,13 +604,13 @@ PDAF --- Distribute sub-ensembles step 16 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.013 s PDAF Call pre-post routine after forecast; step 16 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5309E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.013 s +PDAF --- duration of prestep: 0.011 s PDAF Analysis ------------------------------------------------------- PDAF 16 Assimilating observations - ensemble 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -658,13 +658,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.018 s +PDAF --- duration of En3D-Var update: 0.020 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5259E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.016 s +PDAF --- duration of poststep: 0.011 s PDAF Forecast ------------------------------------------------------- 16 Next observation at time step 18 PDAF Evolve state ensemble @@ -673,13 +673,13 @@ PDAF --- Distribute sub-ensembles step 18 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.021 s +PDAF --- duration of forecast phase: 0.019 s PDAF Call pre-post routine after forecast; step 18 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5259E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.011 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 18 Assimilating observations - ensemble 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -727,13 +727,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.033 s +PDAF --- duration of En3D-Var update: 0.024 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5208E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.010 s +PDAF --- duration of poststep: 0.009 s PDAF Forecast ------------------------------------------------------- 18 No more observations - end assimilation @@ -747,27 +747,25 @@ PDAF analysis step: 0.051 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- -PDAF Initialize PDAF: 0.025 s +PDAF Initialize PDAF: 0.022 s PDAF init_ens_pdaf: 0.004 s -PDAF Ensemble forecast: 0.152 s -PDAF MPI communication in PDAF: 0.152 s +PDAF Ensemble forecast: 0.202 s +PDAF MPI communication in PDAF: 0.202 s PDAF distribute_state_pdaf: 0.000 s PDAF collect_state_pdaf: 0.000 s -PDAF En3DVAR analysis: 0.543 s -PDAF PDAF-internal operations: 0.085 s -PDAF OMI-internal routines: 0.212 s -PDAF Solver: 0.070 s -PDAF cvt_ens_pdaf: 0.024 s -PDAF cvt_ens_adj_pdaf: 0.027 s +PDAF En3DVAR analysis: 0.398 s +PDAF PDAF-internal operations: 0.239 s +PDAF OMI-internal routines: 0.001 s +PDAF Solver: 0.184 s +PDAF cvt_ens_pdaf: 0.066 s +PDAF cvt_ens_adj_pdaf: 0.140 s PDAF Timers in LESTKF only PDAF init_n_domains_pdaf: 0.000 s -PDAF init_dim_l_pdaf: 0.000 s -PDAF g2l_state_pdaf: 0.000 s -PDAF l2g_state_pdaf: 0.001 s +PDAF init_dim_l_pdaf: 0.001 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.145 s -PDAF obs_op_pdafomi: 0.149 s +PDAF init_dim_obs_pdafomi: 0.237 s +PDAF obs_op_pdafomi: 0.115 s PDAF obs_op_lin_pdafomi: 0.000 s PDAF obs_op_adj_pdafomi: 0.000 s -PDAF init_dim_obs_l_pdafomi: 0.008 s -PDAF prepoststep_pdaf: 0.217 s +PDAF init_dim_obs_l_pdafomi: 0.003 s +PDAF prepoststep_pdaf: 0.193 s diff --git a/tutorial/verification/out.online_2D_parallelmodel_3dlenvar_opt13 b/tutorial/verification/out.online_2D_parallelmodel_3dlenvar_opt13 index 0903bc2ab..2ded9da61 100644 --- a/tutorial/verification/out.online_2D_parallelmodel_3dlenvar_opt13 +++ b/tutorial/verification/out.online_2D_parallelmodel_3dlenvar_opt13 @@ -55,7 +55,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -127,7 +127,7 @@ PDAF Call pre-post routine after forecast; step 2 --- compute ensemble mean RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.013 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 2 Assimilating observations - ensemble 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -164,13 +164,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.039 s +PDAF --- duration of En3D-Var update: 0.038 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.6883E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.013 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 2 Next observation at time step 4 PDAF Evolve state ensemble @@ -179,13 +179,13 @@ PDAF --- Distribute sub-ensembles step 4 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.010 s +PDAF --- duration of forecast phase: 0.009 s PDAF Call pre-post routine after forecast; step 4 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.6883E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.012 s +PDAF --- duration of prestep: 0.013 s PDAF Analysis ------------------------------------------------------- PDAF 4 Assimilating observations - ensemble 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -222,7 +222,7 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.034 s +PDAF --- duration of En3D-Var update: 0.018 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean @@ -237,13 +237,13 @@ PDAF --- Distribute sub-ensembles step 6 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.028 s PDAF Call pre-post routine after forecast; step 6 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.6119E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.011 s +PDAF --- duration of prestep: 0.013 s PDAF Analysis ------------------------------------------------------- PDAF 6 Assimilating observations - ensemble 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -280,13 +280,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.018 s +PDAF --- duration of En3D-Var update: 0.027 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5793E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.022 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 6 Next observation at time step 8 PDAF Evolve state ensemble @@ -295,13 +295,13 @@ PDAF --- Distribute sub-ensembles step 8 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.009 s +PDAF --- duration of forecast phase: 0.013 s PDAF Call pre-post routine after forecast; step 8 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5793E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.011 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 8 Assimilating observations - ensemble 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -338,7 +338,7 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.018 s +PDAF --- duration of En3D-Var update: 0.030 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean @@ -353,13 +353,13 @@ PDAF --- Distribute sub-ensembles step 10 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.021 s +PDAF --- duration of forecast phase: 0.041 s PDAF Call pre-post routine after forecast; step 10 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5609E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.012 s +PDAF --- duration of prestep: 0.013 s PDAF Analysis ------------------------------------------------------- PDAF 10 Assimilating observations - ensemble 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -396,7 +396,7 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.034 s +PDAF --- duration of En3D-Var update: 0.017 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean @@ -411,13 +411,13 @@ PDAF --- Distribute sub-ensembles step 12 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.010 s PDAF Call pre-post routine after forecast; step 12 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5473E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.014 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 12 Assimilating observations - ensemble 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -454,13 +454,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.018 s +PDAF --- duration of En3D-Var update: 0.037 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5387E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.023 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 12 Next observation at time step 14 PDAF Evolve state ensemble @@ -469,7 +469,7 @@ PDAF --- Distribute sub-ensembles step 14 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.011 s PDAF Call pre-post routine after forecast; step 14 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -512,7 +512,7 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.018 s +PDAF --- duration of En3D-Var update: 0.027 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean @@ -527,13 +527,13 @@ PDAF --- Distribute sub-ensembles step 16 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.022 s +PDAF --- duration of forecast phase: 0.042 s PDAF Call pre-post routine after forecast; step 16 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5309E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.012 s +PDAF --- duration of prestep: 0.013 s PDAF Analysis ------------------------------------------------------- PDAF 16 Assimilating observations - ensemble 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -570,13 +570,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.035 s +PDAF --- duration of En3D-Var update: 0.018 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5259E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.012 s +PDAF --- duration of poststep: 0.013 s PDAF Forecast ------------------------------------------------------- 16 Next observation at time step 18 PDAF Evolve state ensemble @@ -585,13 +585,13 @@ PDAF --- Distribute sub-ensembles step 18 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.025 s +PDAF --- duration of forecast phase: 0.019 s PDAF Call pre-post routine after forecast; step 18 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5259E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.013 s +PDAF --- duration of prestep: 0.014 s PDAF Analysis ------------------------------------------------------- PDAF 18 Assimilating observations - ensemble 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -628,7 +628,7 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.035 s +PDAF --- duration of En3D-Var update: 0.020 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean @@ -649,26 +649,24 @@ PDAF analysis step: 0.051 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- PDAF Initialize PDAF: 0.022 s -PDAF init_ens_pdaf: 0.004 s -PDAF Ensemble forecast: 0.126 s -PDAF MPI communication in PDAF: 0.126 s +PDAF init_ens_pdaf: 0.003 s +PDAF Ensemble forecast: 0.191 s +PDAF MPI communication in PDAF: 0.191 s PDAF distribute_state_pdaf: 0.000 s PDAF collect_state_pdaf: 0.000 s -PDAF En3DVAR analysis: 0.490 s -PDAF PDAF-internal operations: 0.064 s -PDAF OMI-internal routines: 0.169 s -PDAF Solver: 0.042 s -PDAF cvt_ens_pdaf: 0.021 s -PDAF cvt_ens_adj_pdaf: 0.036 s +PDAF En3DVAR analysis: 0.464 s +PDAF PDAF-internal operations: 0.212 s +PDAF OMI-internal routines: 0.000 s +PDAF Solver: 0.104 s +PDAF cvt_ens_pdaf: 0.122 s +PDAF cvt_ens_adj_pdaf: 0.156 s PDAF Timers in LESTKF only PDAF init_n_domains_pdaf: 0.000 s PDAF init_dim_l_pdaf: 0.000 s -PDAF g2l_state_pdaf: 0.000 s -PDAF l2g_state_pdaf: 0.000 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.115 s -PDAF obs_op_pdafomi: 0.144 s +PDAF init_dim_obs_pdafomi: 0.248 s +PDAF obs_op_pdafomi: 0.122 s PDAF obs_op_lin_pdafomi: 0.000 s PDAF obs_op_adj_pdafomi: 0.000 s -PDAF init_dim_obs_l_pdafomi: 0.010 s -PDAF prepoststep_pdaf: 0.239 s +PDAF init_dim_obs_l_pdafomi: 0.002 s +PDAF prepoststep_pdaf: 0.222 s diff --git a/tutorial/verification/out.online_2D_parallelmodel_3dlhybvar_opt12 b/tutorial/verification/out.online_2D_parallelmodel_3dlhybvar_opt12 index ecd5c8285..454684326 100644 --- a/tutorial/verification/out.online_2D_parallelmodel_3dlhybvar_opt12 +++ b/tutorial/verification/out.online_2D_parallelmodel_3dlhybvar_opt12 @@ -60,7 +60,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -109,7 +109,7 @@ PDAF: Call routine for ensemble initialization Initialize B^1/2 for 3D-Var PDAF: Initialization completed -PDAF --- duration of PDAF initialization: 0.029 s +PDAF --- duration of PDAF initialization: 0.025 s PDAF ---------------------------------------------------------------- @@ -129,13 +129,13 @@ PDAF --- Distribute sub-ensembles step 2 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.024 s +PDAF --- duration of forecast phase: 0.018 s PDAF Call pre-post routine after forecast; step 2 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.013 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 2 Assimilating observations - hybrid 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -184,7 +184,7 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of hyb3D-Var update: 0.044 s +PDAF --- duration of hyb3D-Var update: 0.041 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean @@ -205,7 +205,7 @@ PDAF Call pre-post routine after forecast; step 4 --- compute ensemble mean RMS error according to sampled variance: 5.6883E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.011 s +PDAF --- duration of prestep: 0.013 s PDAF Analysis ------------------------------------------------------- PDAF 4 Assimilating observations - hybrid 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -227,7 +227,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 1.662D+01 6.847D-01 5.3D-02 1.4D-02 - 2 5 1.661D+01 5.031D-09 5.0D-02 -3.4D-15 + 2 5 1.661D+01 5.031D-09 5.0D-02 1.7D-15 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -254,7 +254,7 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of hyb3D-Var update: 0.022 s +PDAF --- duration of hyb3D-Var update: 0.019 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean @@ -269,7 +269,7 @@ PDAF --- Distribute sub-ensembles step 6 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.020 s +PDAF --- duration of forecast phase: 0.076 s PDAF Call pre-post routine after forecast; step 6 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -297,7 +297,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 1.954D+01 4.499D-01 5.9D-02 2.1D-01 - 4 9 1.947D+01 4.970D-11 9.1D-01 2.1D-15 + 4 9 1.947D+01 4.916D-11 9.1D-01 1.5D-14 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -324,13 +324,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of hyb3D-Var update: 0.022 s +PDAF --- duration of hyb3D-Var update: 0.017 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5793E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.013 s +PDAF --- duration of poststep: 0.011 s PDAF Forecast ------------------------------------------------------- 6 Next observation at time step 8 PDAF Evolve state ensemble @@ -339,13 +339,13 @@ PDAF --- Distribute sub-ensembles step 8 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.021 s +PDAF --- duration of forecast phase: 0.011 s PDAF Call pre-post routine after forecast; step 8 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5793E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.013 s +PDAF --- duration of prestep: 0.011 s PDAF Analysis ------------------------------------------------------- PDAF 8 Assimilating observations - hybrid 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -394,7 +394,7 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of hyb3D-Var update: 0.036 s +PDAF --- duration of hyb3D-Var update: 0.018 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean @@ -409,13 +409,13 @@ PDAF --- Distribute sub-ensembles step 10 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.008 s +PDAF --- duration of forecast phase: 0.043 s PDAF Call pre-post routine after forecast; step 10 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5609E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.011 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 10 Assimilating observations - hybrid 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -437,7 +437,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 8.750D+00 1.548D+00 6.3D-02 2.2D-01 - 4 9 8.548D+00 1.281D-11 9.8D-01 8.9D-12 + 4 9 8.548D+00 1.282D-11 9.8D-01 8.2D-12 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -464,7 +464,7 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of hyb3D-Var update: 0.019 s +PDAF --- duration of hyb3D-Var update: 0.017 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean @@ -479,13 +479,13 @@ PDAF --- Distribute sub-ensembles step 12 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.020 s +PDAF --- duration of forecast phase: 0.009 s PDAF Call pre-post routine after forecast; step 12 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5473E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.011 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 12 Assimilating observations - hybrid 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -507,7 +507,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 1.425D+01 7.126D-01 5.5D-02 8.9D-03 - 4 9 1.421D+01 6.549D-12 9.8D-01 -3.5D-13 + 4 9 1.421D+01 6.491D-12 9.8D-01 2.5D-13 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -534,13 +534,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of hyb3D-Var update: 0.036 s +PDAF --- duration of hyb3D-Var update: 0.017 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5387E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.013 s +PDAF --- duration of poststep: 0.011 s PDAF Forecast ------------------------------------------------------- 12 Next observation at time step 14 PDAF Evolve state ensemble @@ -549,13 +549,13 @@ PDAF --- Distribute sub-ensembles step 14 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.043 s PDAF Call pre-post routine after forecast; step 14 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5387E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.020 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 14 Assimilating observations - hybrid 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -577,7 +577,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 1.327D+01 1.483D+00 1.3D-01 7.4D-02 - 4 9 1.317D+01 7.966D-12 9.7D-01 3.0D-13 + 4 9 1.317D+01 7.966D-12 9.7D-01 1.6D-12 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -604,7 +604,7 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of hyb3D-Var update: 0.019 s +PDAF --- duration of hyb3D-Var update: 0.017 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean @@ -619,13 +619,13 @@ PDAF --- Distribute sub-ensembles step 16 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.021 s +PDAF --- duration of forecast phase: 0.030 s PDAF Call pre-post routine after forecast; step 16 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5309E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.010 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 16 Assimilating observations - hybrid 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -647,7 +647,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 1.804D+01 7.156D-01 5.8D-02 6.2D-02 - 4 9 1.792D+01 8.837D-12 9.7D-01 -2.0D-13 + 4 9 1.792D+01 8.866D-12 9.7D-01 1.6D-13 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -674,7 +674,7 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of hyb3D-Var update: 0.018 s +PDAF --- duration of hyb3D-Var update: 0.017 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean @@ -689,13 +689,13 @@ PDAF --- Distribute sub-ensembles step 18 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.018 s +PDAF --- duration of forecast phase: 0.022 s PDAF Call pre-post routine after forecast; step 18 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5259E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.012 s +PDAF --- duration of prestep: 0.014 s PDAF Analysis ------------------------------------------------------- PDAF 18 Assimilating observations - hybrid 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -717,7 +717,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 2.234D+01 1.766D+00 6.2D-02 1.4D-01 - 4 9 2.205D+01 1.411D-11 9.8D-01 -3.1D-13 + 4 9 2.205D+01 1.413D-11 9.8D-01 2.8D-13 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -744,13 +744,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of hyb3D-Var update: 0.022 s +PDAF --- duration of hyb3D-Var update: 0.004 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5208E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.010 s +PDAF --- duration of poststep: 0.011 s PDAF Forecast ------------------------------------------------------- 18 No more observations - end assimilation @@ -764,27 +764,25 @@ PDAF analysis step: 0.056 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- -PDAF Initialize PDAF: 0.029 s +PDAF Initialize PDAF: 0.025 s PDAF init_ens_pdaf: 0.004 s -PDAF Ensemble forecast: 0.147 s -PDAF MPI communication in PDAF: 0.146 s +PDAF Ensemble forecast: 0.260 s +PDAF MPI communication in PDAF: 0.259 s PDAF distribute_state_pdaf: 0.000 s PDAF collect_state_pdaf: 0.000 s -PDAF Hyb3DVAR analysis: 0.467 s -PDAF PDAF-internal operations: 0.083 s -PDAF OMI-internal routines: 0.479 s -PDAF Solver: 0.128 s -PDAF cvt_ens_pdaf: 0.056 s -PDAF cvt_ens_adj_pdaf: 0.051 s +PDAF Hyb3DVAR analysis: 0.334 s +PDAF PDAF-internal operations: 0.198 s +PDAF OMI-internal routines: 0.002 s +PDAF Solver: 0.137 s +PDAF cvt_ens_pdaf: 0.199 s +PDAF cvt_ens_adj_pdaf: 0.077 s PDAF Timers in LESTKF only PDAF init_n_domains_pdaf: 0.000 s PDAF init_dim_l_pdaf: 0.000 s -PDAF g2l_state_pdaf: 0.001 s -PDAF l2g_state_pdaf: 0.001 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.083 s -PDAF obs_op_pdafomi: 0.167 s +PDAF init_dim_obs_pdafomi: 0.299 s +PDAF obs_op_pdafomi: 0.102 s PDAF obs_op_lin_pdafomi: 0.000 s PDAF obs_op_adj_pdafomi: 0.000 s -PDAF init_dim_obs_l_pdafomi: 0.005 s -PDAF prepoststep_pdaf: 0.220 s +PDAF init_dim_obs_l_pdafomi: 0.003 s +PDAF prepoststep_pdaf: 0.214 s diff --git a/tutorial/verification/out.online_2D_parallelmodel_3dlhybvar_opt13 b/tutorial/verification/out.online_2D_parallelmodel_3dlhybvar_opt13 index 5281cc9c3..35dabf0d6 100644 --- a/tutorial/verification/out.online_2D_parallelmodel_3dlhybvar_opt13 +++ b/tutorial/verification/out.online_2D_parallelmodel_3dlhybvar_opt13 @@ -60,7 +60,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -109,7 +109,7 @@ PDAF: Call routine for ensemble initialization Initialize B^1/2 for 3D-Var PDAF: Initialization completed -PDAF --- duration of PDAF initialization: 0.023 s +PDAF --- duration of PDAF initialization: 0.022 s PDAF ---------------------------------------------------------------- @@ -129,7 +129,7 @@ PDAF --- Distribute sub-ensembles step 2 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.018 s +PDAF --- duration of forecast phase: 0.019 s PDAF Call pre-post routine after forecast; step 2 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -173,13 +173,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of hyb3D-Var update: 0.046 s +PDAF --- duration of hyb3D-Var update: 0.039 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.6883E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.014 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 2 Next observation at time step 4 PDAF Evolve state ensemble @@ -188,7 +188,7 @@ PDAF --- Distribute sub-ensembles step 4 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.009 s PDAF Call pre-post routine after forecast; step 4 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -232,7 +232,7 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of hyb3D-Var update: 0.037 s +PDAF --- duration of hyb3D-Var update: 0.018 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean @@ -247,13 +247,13 @@ PDAF --- Distribute sub-ensembles step 6 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.035 s PDAF Call pre-post routine after forecast; step 6 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.6119E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.017 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 6 Assimilating observations - hybrid 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -291,7 +291,7 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of hyb3D-Var update: 0.035 s +PDAF --- duration of hyb3D-Var update: 0.018 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean @@ -306,13 +306,13 @@ PDAF --- Distribute sub-ensembles step 8 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.041 s PDAF Call pre-post routine after forecast; step 8 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5793E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.019 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 8 Assimilating observations - hybrid 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -350,13 +350,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of hyb3D-Var update: 0.035 s +PDAF --- duration of hyb3D-Var update: 0.017 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5609E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.012 s +PDAF --- duration of poststep: 0.011 s PDAF Forecast ------------------------------------------------------- 8 Next observation at time step 10 PDAF Evolve state ensemble @@ -365,13 +365,13 @@ PDAF --- Distribute sub-ensembles step 10 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.010 s PDAF Call pre-post routine after forecast; step 10 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5609E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.014 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 10 Assimilating observations - hybrid 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -409,13 +409,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of hyb3D-Var update: 0.034 s +PDAF --- duration of hyb3D-Var update: 0.018 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5473E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.013 s +PDAF --- duration of poststep: 0.011 s PDAF Forecast ------------------------------------------------------- 10 Next observation at time step 12 PDAF Evolve state ensemble @@ -424,13 +424,13 @@ PDAF --- Distribute sub-ensembles step 12 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.008 s +PDAF --- duration of forecast phase: 0.011 s PDAF Call pre-post routine after forecast; step 12 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5473E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.024 s +PDAF --- duration of prestep: 0.014 s PDAF Analysis ------------------------------------------------------- PDAF 12 Assimilating observations - hybrid 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -468,13 +468,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of hyb3D-Var update: 0.036 s +PDAF --- duration of hyb3D-Var update: 0.017 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5387E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.013 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 12 Next observation at time step 14 PDAF Evolve state ensemble @@ -483,13 +483,13 @@ PDAF --- Distribute sub-ensembles step 14 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.042 s PDAF Call pre-post routine after forecast; step 14 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5387E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.014 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 14 Assimilating observations - hybrid 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -527,13 +527,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of hyb3D-Var update: 0.036 s +PDAF --- duration of hyb3D-Var update: 0.017 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5309E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.013 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 14 Next observation at time step 16 PDAF Evolve state ensemble @@ -542,13 +542,13 @@ PDAF --- Distribute sub-ensembles step 16 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.009 s PDAF Call pre-post routine after forecast; step 16 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5309E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.018 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 16 Assimilating observations - hybrid 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -586,7 +586,7 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of hyb3D-Var update: 0.033 s +PDAF --- duration of hyb3D-Var update: 0.017 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean @@ -601,13 +601,13 @@ PDAF --- Distribute sub-ensembles step 18 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.020 s +PDAF --- duration of forecast phase: 0.041 s PDAF Call pre-post routine after forecast; step 18 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5259E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.019 s +PDAF --- duration of prestep: 0.015 s PDAF Analysis ------------------------------------------------------- PDAF 18 Assimilating observations - hybrid 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -645,13 +645,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of hyb3D-Var update: 0.018 s +PDAF --- duration of hyb3D-Var update: 0.017 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5208E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.012 s +PDAF --- duration of poststep: 0.011 s PDAF Forecast ------------------------------------------------------- 18 No more observations - end assimilation @@ -665,27 +665,25 @@ PDAF analysis step: 0.056 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- -PDAF Initialize PDAF: 0.023 s -PDAF init_ens_pdaf: 0.004 s -PDAF Ensemble forecast: 0.088 s -PDAF MPI communication in PDAF: 0.088 s +PDAF Initialize PDAF: 0.022 s +PDAF init_ens_pdaf: 0.003 s +PDAF Ensemble forecast: 0.217 s +PDAF MPI communication in PDAF: 0.217 s PDAF distribute_state_pdaf: 0.000 s PDAF collect_state_pdaf: 0.000 s -PDAF Hyb3DVAR analysis: 0.612 s -PDAF PDAF-internal operations: 0.054 s -PDAF OMI-internal routines: 0.248 s -PDAF Solver: 0.035 s -PDAF cvt_ens_pdaf: 0.038 s -PDAF cvt_ens_adj_pdaf: 0.042 s +PDAF Hyb3DVAR analysis: 0.356 s +PDAF PDAF-internal operations: 0.150 s +PDAF OMI-internal routines: 0.001 s +PDAF Solver: 0.082 s +PDAF cvt_ens_pdaf: 0.178 s +PDAF cvt_ens_adj_pdaf: 0.089 s PDAF Timers in LESTKF only PDAF init_n_domains_pdaf: 0.000 s -PDAF init_dim_l_pdaf: 0.000 s -PDAF g2l_state_pdaf: 0.000 s -PDAF l2g_state_pdaf: 0.002 s +PDAF init_dim_l_pdaf: 0.001 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.096 s -PDAF obs_op_pdafomi: 0.232 s +PDAF init_dim_obs_pdafomi: 0.255 s +PDAF obs_op_pdafomi: 0.112 s PDAF obs_op_lin_pdafomi: 0.000 s PDAF obs_op_adj_pdafomi: 0.000 s -PDAF init_dim_obs_l_pdafomi: 0.008 s -PDAF prepoststep_pdaf: 0.264 s +PDAF init_dim_obs_l_pdafomi: 0.004 s +PDAF prepoststep_pdaf: 0.220 s diff --git a/tutorial/verification/out.online_2D_parallelmodel_3dv_opt1 b/tutorial/verification/out.online_2D_parallelmodel_3dv_opt1 index a7b6735eb..313af086d 100644 --- a/tutorial/verification/out.online_2D_parallelmodel_3dv_opt1 +++ b/tutorial/verification/out.online_2D_parallelmodel_3dv_opt1 @@ -35,7 +35,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -103,7 +103,7 @@ PDAF Call pre-post routine after forecast; step 2 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.003 s +PDAF --- duration of prestep: 0.002 s PDAF Analysis ------------------------------------------------------- PDAF 2 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: LBFGS @@ -137,15 +137,15 @@ F = final function value CONVERGENCE: REL_REDUCTION_OF_F_<=_FACTR*EPSMCH - Total User time 2.290E-04 seconds. + Total User time 1.890E-04 seconds. PDAF --- Exit optimization, status CONVERGENCE: REL_REDUCTION_OF_F_<=_FACTR*EPSMCH -PDAF --- update duration: 0.001 s +PDAF --- update duration: 0.000 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.002 s +PDAF --- duration of poststep: 0.001 s PDAF Forecast ------------------------------------------------------- 2 Next observation at time step 4 PDAF Evolve state ensemble @@ -191,7 +191,7 @@ F = final function value CONVERGENCE: REL_REDUCTION_OF_F_<=_FACTR*EPSMCH - Total User time 1.070E-04 seconds. + Total User time 8.600E-05 seconds. PDAF --- Exit optimization, status CONVERGENCE: REL_REDUCTION_OF_F_<=_FACTR*EPSMCH PDAF --- update duration: 0.000 s @@ -199,7 +199,7 @@ PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.002 s +PDAF --- duration of poststep: 0.001 s PDAF Forecast ------------------------------------------------------- 4 Next observation at time step 6 PDAF Evolve state ensemble @@ -245,15 +245,15 @@ F = final function value CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL - Total User time 8.200E-05 seconds. + Total User time 1.090E-04 seconds. PDAF --- Exit optimization, status CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL -PDAF --- update duration: 0.001 s +PDAF --- update duration: 0.000 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.001 s +PDAF --- duration of poststep: 0.002 s PDAF Forecast ------------------------------------------------------- 6 Next observation at time step 8 PDAF Evolve state ensemble @@ -265,7 +265,7 @@ PDAF Call pre-post routine after forecast; step 8 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.002 s +PDAF --- duration of prestep: 0.001 s PDAF Analysis ------------------------------------------------------- PDAF 8 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: LBFGS @@ -299,15 +299,15 @@ F = final function value CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL - Total User time 6.100E-05 seconds. + Total User time 6.900E-05 seconds. PDAF --- Exit optimization, status CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL -PDAF --- update duration: 0.000 s +PDAF --- update duration: 0.001 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.003 s +PDAF --- duration of poststep: 0.001 s PDAF Forecast ------------------------------------------------------- 8 Next observation at time step 10 PDAF Evolve state ensemble @@ -319,7 +319,7 @@ PDAF Call pre-post routine after forecast; step 10 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.003 s +PDAF --- duration of prestep: 0.001 s PDAF Analysis ------------------------------------------------------- PDAF 10 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: LBFGS @@ -353,7 +353,7 @@ F = final function value CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL - Total User time 1.200E-04 seconds. + Total User time 6.600E-05 seconds. PDAF --- Exit optimization, status CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL PDAF --- update duration: 0.001 s @@ -361,7 +361,7 @@ PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.002 s +PDAF --- duration of poststep: 0.001 s PDAF Forecast ------------------------------------------------------- 10 Next observation at time step 12 PDAF Evolve state ensemble @@ -373,7 +373,7 @@ PDAF Call pre-post routine after forecast; step 12 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.003 s +PDAF --- duration of prestep: 0.002 s PDAF Analysis ------------------------------------------------------- PDAF 12 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: LBFGS @@ -407,7 +407,7 @@ F = final function value CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL - Total User time 1.120E-04 seconds. + Total User time 1.050E-04 seconds. PDAF --- Exit optimization, status CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL PDAF --- update duration: 0.001 s @@ -415,7 +415,7 @@ PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.003 s +PDAF --- duration of poststep: 0.001 s PDAF Forecast ------------------------------------------------------- 12 Next observation at time step 14 PDAF Evolve state ensemble @@ -427,7 +427,7 @@ PDAF Call pre-post routine after forecast; step 14 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.002 s +PDAF --- duration of prestep: 0.003 s PDAF Analysis ------------------------------------------------------- PDAF 14 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: LBFGS @@ -461,7 +461,7 @@ F = final function value CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL - Total User time 9.999E-05 seconds. + Total User time 1.520E-04 seconds. PDAF --- Exit optimization, status CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL PDAF --- update duration: 0.000 s @@ -469,7 +469,7 @@ PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.002 s +PDAF --- duration of poststep: 0.003 s PDAF Forecast ------------------------------------------------------- 14 Next observation at time step 16 PDAF Evolve state ensemble @@ -481,7 +481,7 @@ PDAF Call pre-post routine after forecast; step 16 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.002 s +PDAF --- duration of prestep: 0.003 s PDAF Analysis ------------------------------------------------------- PDAF 16 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: LBFGS @@ -515,7 +515,7 @@ F = final function value CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL - Total User time 7.300E-05 seconds. + Total User time 1.140E-04 seconds. PDAF --- Exit optimization, status CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL PDAF --- update duration: 0.000 s @@ -523,7 +523,7 @@ PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.001 s +PDAF --- duration of poststep: 0.003 s PDAF Forecast ------------------------------------------------------- 16 Next observation at time step 18 PDAF Evolve state ensemble @@ -535,7 +535,7 @@ PDAF Call pre-post routine after forecast; step 18 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.002 s +PDAF --- duration of prestep: 0.003 s PDAF Analysis ------------------------------------------------------- PDAF 18 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: LBFGS @@ -569,7 +569,7 @@ F = final function value CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL - Total User time 7.300E-05 seconds. + Total User time 1.120E-04 seconds. PDAF --- Exit optimization, status CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL PDAF --- update duration: 0.000 s @@ -577,7 +577,7 @@ PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.002 s +PDAF --- duration of poststep: 0.003 s PDAF Forecast ------------------------------------------------------- 18 No more observations - end assimilation @@ -597,15 +597,15 @@ PDAF State forecast: 0.000 s PDAF MPI communication in PDAF: 0.000 s PDAF distribute_state_pdaf: 0.000 s PDAF collect_state_pdaf: 0.000 s -PDAF 3DVAR analysis: 0.004 s -PDAF PDAF-internal operations: 0.001 s -PDAF OMI-internal routines: 0.002 s -PDAF Solver: 0.000 s +PDAF 3DVAR analysis: 0.003 s +PDAF PDAF-internal operations: 0.000 s +PDAF OMI-internal routines: 0.000 s +PDAF Solver: 0.001 s PDAF cvt_pdaf: 0.000 s PDAF cvt_adj_pdaf: 0.000 s PDAF Time in OMI observation module routines PDAF init_dim_obs_pdafomi: 0.002 s PDAF obs_op_pdafomi: 0.000 s PDAF obs_op_lin_pdafomi: 0.000 s -PDAF obs_op_adj_pdafomi: 0.001 s -PDAF prepoststep_pdaf: 0.039 s +PDAF obs_op_adj_pdafomi: 0.000 s +PDAF prepoststep_pdaf: 0.035 s diff --git a/tutorial/verification/out.online_2D_parallelmodel_3dv_opt12 b/tutorial/verification/out.online_2D_parallelmodel_3dv_opt12 index 149b4c567..0f84ab320 100644 --- a/tutorial/verification/out.online_2D_parallelmodel_3dv_opt12 +++ b/tutorial/verification/out.online_2D_parallelmodel_3dv_opt12 @@ -40,7 +40,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -86,7 +86,7 @@ PDAF: Call routine for ensemble initialization Initialize B^1/2 PDAF: Initialization completed -PDAF --- duration of PDAF initialization: 0.003 s +PDAF --- duration of PDAF initialization: 0.002 s PDAF ---------------------------------------------------------------- @@ -96,7 +96,7 @@ PDAF Call pre-post routine at initial time Analyze initial state for 3D-Var Initialize B^1/2 RMS error according to sampled variance: 5.7637E-01 -PDAF --- duration of prestep: 0.002 s +PDAF --- duration of prestep: 0.001 s PDAF Forecast ------------------------------------------------------- 0 Next observation at time step 2 PDAF Evolve state ensemble @@ -133,7 +133,7 @@ INITIAL VALUES: SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 -PDAF --- update duration: 0.029 s +PDAF --- update duration: 0.019 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 @@ -174,12 +174,12 @@ INITIAL VALUES: SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 -PDAF --- update duration: 0.026 s +PDAF --- update duration: 0.019 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.003 s +PDAF --- duration of poststep: 0.002 s PDAF Forecast ------------------------------------------------------- 4 Next observation at time step 6 PDAF Evolve state ensemble @@ -191,7 +191,7 @@ PDAF Call pre-post routine after forecast; step 6 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.003 s +PDAF --- duration of prestep: 0.001 s PDAF Analysis ------------------------------------------------------- PDAF 6 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: CG+ parallelized @@ -215,12 +215,12 @@ INITIAL VALUES: SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 -PDAF --- update duration: 0.027 s +PDAF --- update duration: 0.019 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.003 s +PDAF --- duration of poststep: 0.002 s PDAF Forecast ------------------------------------------------------- 6 Next observation at time step 8 PDAF Evolve state ensemble @@ -256,12 +256,12 @@ INITIAL VALUES: SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 -PDAF --- update duration: 0.011 s +PDAF --- update duration: 0.009 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.001 s +PDAF --- duration of poststep: 0.002 s PDAF Forecast ------------------------------------------------------- 8 Next observation at time step 10 PDAF Evolve state ensemble @@ -273,7 +273,7 @@ PDAF Call pre-post routine after forecast; step 10 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.001 s +PDAF --- duration of prestep: 0.002 s PDAF Analysis ------------------------------------------------------- PDAF 10 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: CG+ parallelized @@ -297,12 +297,12 @@ INITIAL VALUES: SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 -PDAF --- update duration: 0.014 s +PDAF --- update duration: 0.012 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.003 s +PDAF --- duration of poststep: 0.002 s PDAF Forecast ------------------------------------------------------- 10 Next observation at time step 12 PDAF Evolve state ensemble @@ -338,12 +338,12 @@ INITIAL VALUES: SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 -PDAF --- update duration: 0.010 s +PDAF --- update duration: 0.015 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.001 s +PDAF --- duration of poststep: 0.003 s PDAF Forecast ------------------------------------------------------- 12 Next observation at time step 14 PDAF Evolve state ensemble @@ -355,7 +355,7 @@ PDAF Call pre-post routine after forecast; step 14 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.001 s +PDAF --- duration of prestep: 0.003 s PDAF Analysis ------------------------------------------------------- PDAF 14 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: CG+ parallelized @@ -379,12 +379,12 @@ INITIAL VALUES: SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 -PDAF --- update duration: 0.009 s +PDAF --- update duration: 0.015 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.002 s +PDAF --- duration of poststep: 0.003 s PDAF Forecast ------------------------------------------------------- 14 Next observation at time step 16 PDAF Evolve state ensemble @@ -396,7 +396,7 @@ PDAF Call pre-post routine after forecast; step 16 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.002 s +PDAF --- duration of prestep: 0.003 s PDAF Analysis ------------------------------------------------------- PDAF 16 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: CG+ parallelized @@ -420,12 +420,12 @@ INITIAL VALUES: SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 -PDAF --- update duration: 0.010 s +PDAF --- update duration: 0.014 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.003 s +PDAF --- duration of poststep: 0.004 s PDAF Forecast ------------------------------------------------------- 16 Next observation at time step 18 PDAF Evolve state ensemble @@ -461,12 +461,12 @@ INITIAL VALUES: SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 -PDAF --- update duration: 0.013 s +PDAF --- update duration: 0.015 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.002 s +PDAF --- duration of poststep: 0.003 s PDAF Forecast ------------------------------------------------------- 18 No more observations - end assimilation @@ -480,21 +480,21 @@ PDAF analysis step: 0.011 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- -PDAF Initialize PDAF: 0.003 s -PDAF init_ens_pdaf: 0.003 s +PDAF Initialize PDAF: 0.002 s +PDAF init_ens_pdaf: 0.002 s PDAF State forecast: 0.000 s PDAF MPI communication in PDAF: 0.000 s PDAF distribute_state_pdaf: 0.000 s PDAF collect_state_pdaf: 0.000 s -PDAF 3DVAR analysis: 0.149 s -PDAF PDAF-internal operations: 0.035 s -PDAF OMI-internal routines: 0.135 s -PDAF Solver: 0.045 s -PDAF cvt_pdaf: 0.017 s -PDAF cvt_adj_pdaf: 0.026 s +PDAF 3DVAR analysis: 0.137 s +PDAF PDAF-internal operations: 0.036 s +PDAF OMI-internal routines: 0.000 s +PDAF Solver: 0.047 s +PDAF cvt_pdaf: 0.014 s +PDAF cvt_adj_pdaf: 0.022 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.014 s +PDAF init_dim_obs_pdafomi: 0.011 s PDAF obs_op_pdafomi: 0.000 s PDAF obs_op_lin_pdafomi: 0.000 s PDAF obs_op_adj_pdafomi: 0.000 s -PDAF prepoststep_pdaf: 0.038 s +PDAF prepoststep_pdaf: 0.042 s diff --git a/tutorial/verification/out.online_2D_parallelmodel_3dv_opt13 b/tutorial/verification/out.online_2D_parallelmodel_3dv_opt13 index 594aac2e4..c9543b5a7 100644 --- a/tutorial/verification/out.online_2D_parallelmodel_3dv_opt13 +++ b/tutorial/verification/out.online_2D_parallelmodel_3dv_opt13 @@ -40,7 +40,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -96,7 +96,7 @@ PDAF Call pre-post routine at initial time Analyze initial state for 3D-Var Initialize B^1/2 RMS error according to sampled variance: 5.7637E-01 -PDAF --- duration of prestep: 0.002 s +PDAF --- duration of prestep: 0.001 s PDAF Forecast ------------------------------------------------------- 0 Next observation at time step 2 PDAF Evolve state ensemble @@ -109,7 +109,7 @@ PDAF Call pre-post routine after forecast; step 2 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.004 s +PDAF --- duration of prestep: 0.002 s PDAF Analysis ------------------------------------------------------- PDAF 2 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: plain CG parallelized @@ -122,7 +122,7 @@ PDAF --- CG solver converged PDAF iter eps F PDAF 4 0.000E+00 1.878E+01 -PDAF --- update duration: 0.020 s +PDAF --- update duration: 0.016 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 @@ -182,12 +182,12 @@ PDAF --- CG solver converged PDAF iter eps F PDAF 4 0.000E+00 1.947E+01 -PDAF --- update duration: 0.022 s +PDAF --- update duration: 0.015 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.004 s +PDAF --- duration of poststep: 0.003 s PDAF Forecast ------------------------------------------------------- 6 Next observation at time step 8 PDAF Evolve state ensemble @@ -199,7 +199,7 @@ PDAF Call pre-post routine after forecast; step 8 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.002 s +PDAF --- duration of prestep: 0.001 s PDAF Analysis ------------------------------------------------------- PDAF 8 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: plain CG parallelized @@ -212,7 +212,7 @@ PDAF --- CG solver converged PDAF iter eps F PDAF 4 1.776E-15 9.365E+00 -PDAF --- update duration: 0.009 s +PDAF --- update duration: 0.008 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 @@ -242,7 +242,7 @@ PDAF --- CG solver converged PDAF iter eps F PDAF 4 0.000E+00 8.214E+00 -PDAF --- update duration: 0.008 s +PDAF --- update duration: 0.009 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 @@ -277,7 +277,7 @@ PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.002 s +PDAF --- duration of poststep: 0.003 s PDAF Forecast ------------------------------------------------------- 12 Next observation at time step 14 PDAF Evolve state ensemble @@ -289,7 +289,7 @@ PDAF Call pre-post routine after forecast; step 14 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.001 s +PDAF --- duration of prestep: 0.003 s PDAF Analysis ------------------------------------------------------- PDAF 14 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: plain CG parallelized @@ -302,12 +302,12 @@ PDAF --- CG solver converged PDAF iter eps F PDAF 4 3.553E-15 1.311E+01 -PDAF --- update duration: 0.010 s +PDAF --- update duration: 0.013 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.001 s +PDAF --- duration of poststep: 0.003 s PDAF Forecast ------------------------------------------------------- 14 Next observation at time step 16 PDAF Evolve state ensemble @@ -319,7 +319,7 @@ PDAF Call pre-post routine after forecast; step 16 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.002 s +PDAF --- duration of prestep: 0.003 s PDAF Analysis ------------------------------------------------------- PDAF 16 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: plain CG parallelized @@ -332,12 +332,12 @@ PDAF --- CG solver converged PDAF iter eps F PDAF 4 0.000E+00 1.739E+01 -PDAF --- update duration: 0.008 s +PDAF --- update duration: 0.013 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.002 s +PDAF --- duration of poststep: 0.004 s PDAF Forecast ------------------------------------------------------- 16 Next observation at time step 18 PDAF Evolve state ensemble @@ -362,7 +362,7 @@ PDAF --- CG solver converged PDAF iter eps F PDAF 4 3.553E-15 2.234E+01 -PDAF --- update duration: 0.011 s +PDAF --- update duration: 0.014 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 @@ -388,14 +388,14 @@ PDAF MPI communication in PDAF: 0.000 s PDAF distribute_state_pdaf: 0.000 s PDAF collect_state_pdaf: 0.000 s PDAF 3DVAR analysis: 0.116 s -PDAF PDAF-internal operations: 0.029 s -PDAF OMI-internal routines: 0.104 s -PDAF Solver: 0.023 s -PDAF cvt_pdaf: 0.026 s -PDAF cvt_adj_pdaf: 0.024 s +PDAF PDAF-internal operations: 0.030 s +PDAF OMI-internal routines: 0.000 s +PDAF Solver: 0.024 s +PDAF cvt_pdaf: 0.022 s +PDAF cvt_adj_pdaf: 0.025 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.012 s +PDAF init_dim_obs_pdafomi: 0.013 s PDAF obs_op_pdafomi: 0.000 s PDAF obs_op_lin_pdafomi: 0.000 s PDAF obs_op_adj_pdafomi: 0.000 s -PDAF prepoststep_pdaf: 0.045 s +PDAF prepoststep_pdaf: 0.048 s diff --git a/tutorial/verification/out.online_2D_parallelmodel_ESTKF b/tutorial/verification/out.online_2D_parallelmodel_ESTKF index 82d82fe20..9584d7d4c 100644 --- a/tutorial/verification/out.online_2D_parallelmodel_ESTKF +++ b/tutorial/verification/out.online_2D_parallelmodel_ESTKF @@ -53,7 +53,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -374,16 +374,16 @@ PDAF analysis step: 0.044 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- -PDAF Initialize PDAF: 0.040 s -PDAF init_ens_pdaf: 0.003 s -PDAF Ensemble forecast: 0.084 s -PDAF MPI communication in PDAF: 0.083 s +PDAF Initialize PDAF: 0.025 s +PDAF init_ens_pdaf: 0.004 s +PDAF Ensemble forecast: 0.146 s +PDAF MPI communication in PDAF: 0.146 s PDAF distribute_state_pdaf: 0.000 s PDAF collect_state_pdaf: 0.000 s -PDAF ESTKF analysis: 0.096 s -PDAF PDAF-internal operations: 0.011 s -PDAF OMI-internal routines: 0.015 s +PDAF ESTKF analysis: 0.194 s +PDAF PDAF-internal operations: 0.080 s +PDAF OMI-internal routines: 0.000 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.085 s +PDAF init_dim_obs_pdafomi: 0.114 s PDAF obs_op_pdafomi: 0.000 s -PDAF prepoststep_pdaf: 0.288 s +PDAF prepoststep_pdaf: 0.261 s diff --git a/tutorial/verification/out.online_2D_parallelmodel_fullpar b/tutorial/verification/out.online_2D_parallelmodel_fullpar index 6152af6a8..8f9749cae 100644 --- a/tutorial/verification/out.online_2D_parallelmodel_fullpar +++ b/tutorial/verification/out.online_2D_parallelmodel_fullpar @@ -17,8 +17,8 @@ 8 4 0 1 4 M 14 7 0 1 7 M 13 6 1 2 6 M - 12 6 0 1 6 M 19 9 1 2 9 M + 12 6 0 1 6 M 18 9 0 1 9 M 17 8 1 2 8 M 3 1 1 2 1 M @@ -55,7 +55,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -511,21 +511,19 @@ PDAF analysis step: 0.039 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- -PDAF Initialize PDAF: 0.056 s +PDAF Initialize PDAF: 0.027 s PDAF init_ens_pdaf: 0.004 s -PDAF Ensemble forecast: 0.210 s -PDAF MPI communication in PDAF: 0.210 s +PDAF Ensemble forecast: 0.169 s +PDAF MPI communication in PDAF: 0.169 s PDAF distribute_state_pdaf: 0.000 s PDAF collect_state_pdaf: 0.000 s -PDAF LESTKF analysis: 0.333 s -PDAF PDAF-internal operations: 0.052 s -PDAF OMI-internal routines: 0.047 s +PDAF LESTKF analysis: 0.802 s +PDAF PDAF-internal operations: 0.030 s +PDAF OMI-internal routines: 0.000 s PDAF init_n_domains_pdaf: 0.000 s PDAF init_dim_l_pdaf: 0.001 s -PDAF g2l_state_pdaf: 0.000 s -PDAF l2g_state_pdaf: 0.000 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.079 s -PDAF obs_op_pdafomi: 0.238 s -PDAF init_dim_obs_l_pdafomi: 0.008 s -PDAF prepoststep_pdaf: 0.293 s +PDAF init_dim_obs_pdafomi: 0.279 s +PDAF obs_op_pdafomi: 0.488 s +PDAF init_dim_obs_l_pdafomi: 0.004 s +PDAF prepoststep_pdaf: 0.234 s diff --git a/tutorial/verification/out.online_2D_parallelmodel_fullpar_1fpe b/tutorial/verification/out.online_2D_parallelmodel_fullpar_1fpe index 79b32af13..5213257c5 100644 --- a/tutorial/verification/out.online_2D_parallelmodel_fullpar_1fpe +++ b/tutorial/verification/out.online_2D_parallelmodel_fullpar_1fpe @@ -6,15 +6,15 @@ world filter model couple model/filter rank rank task rank task rank M/F ---------------------------------------------------------- - 11 6 0 1 6 M 7 4 0 1 4 M - 3 2 0 1 2 M + 11 6 0 1 6 M 6 3 1 M 10 5 1 M - 15 8 0 1 8 M - 9 5 0 1 5 M 5 3 0 1 3 M + 9 5 0 1 5 M 12 6 1 M + 3 2 0 1 2 M + 15 8 0 1 8 M 8 4 1 M 4 2 1 M 14 7 1 M @@ -54,7 +54,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -510,21 +510,19 @@ PDAF analysis step: 0.020 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- -PDAF Initialize PDAF: 0.030 s -PDAF init_ens_pdaf: 0.004 s -PDAF Ensemble forecast: 0.201 s -PDAF MPI communication in PDAF: 0.201 s +PDAF Initialize PDAF: 0.015 s +PDAF init_ens_pdaf: 0.003 s +PDAF Ensemble forecast: 0.306 s +PDAF MPI communication in PDAF: 0.306 s PDAF distribute_state_pdaf: 0.000 s PDAF collect_state_pdaf: 0.000 s -PDAF LESTKF analysis: 0.032 s -PDAF PDAF-internal operations: 0.010 s -PDAF OMI-internal routines: 0.019 s +PDAF LESTKF analysis: 0.025 s +PDAF PDAF-internal operations: 0.008 s +PDAF OMI-internal routines: 0.001 s PDAF init_n_domains_pdaf: 0.000 s PDAF init_dim_l_pdaf: 0.001 s -PDAF g2l_state_pdaf: 0.001 s -PDAF l2g_state_pdaf: 0.001 s PDAF Time in OMI observation module routines PDAF init_dim_obs_pdafomi: 0.005 s PDAF obs_op_pdafomi: 0.000 s -PDAF init_dim_obs_l_pdafomi: 0.013 s -PDAF prepoststep_pdaf: 0.280 s +PDAF init_dim_obs_l_pdafomi: 0.007 s +PDAF prepoststep_pdaf: 0.288 s diff --git a/tutorial/verification/out.online_2D_serial_3dv_opt1 b/tutorial/verification/out.online_2D_serial_3dv_opt1 index c02908adb..cd3eb490d 100644 --- a/tutorial/verification/out.online_2D_serial_3dv_opt1 +++ b/tutorial/verification/out.online_2D_serial_3dv_opt1 @@ -32,7 +32,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -100,7 +100,7 @@ PDAF Call pre-post routine after forecast; step 2 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.002 s +PDAF --- duration of prestep: 0.001 s PDAF Analysis ------------------------------------------------------- PDAF 2 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: LBFGS @@ -135,7 +135,7 @@ F = final function value CONVERGENCE: REL_REDUCTION_OF_F_<=_FACTR*EPSMCH - Total User time 2.200E-04 seconds. + Total User time 1.950E-04 seconds. PDAF --- Exit optimization, status CONVERGENCE: REL_REDUCTION_OF_F_<=_FACTR*EPSMCH PDAF --- update duration: 0.001 s @@ -143,7 +143,7 @@ PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.002 s +PDAF --- duration of poststep: 0.001 s PDAF Forecast ------------------------------------------------------- 2 Next observation at time step 4 PDAF Evolve state ensemble @@ -190,7 +190,7 @@ F = final function value CONVERGENCE: REL_REDUCTION_OF_F_<=_FACTR*EPSMCH - Total User time 1.270E-04 seconds. + Total User time 9.800E-05 seconds. PDAF --- Exit optimization, status CONVERGENCE: REL_REDUCTION_OF_F_<=_FACTR*EPSMCH PDAF --- update duration: 0.000 s @@ -245,15 +245,15 @@ F = final function value CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL - Total User time 6.900E-05 seconds. + Total User time 7.900E-05 seconds. PDAF --- Exit optimization, status CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL -PDAF --- update duration: 0.000 s +PDAF --- update duration: 0.001 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.002 s +PDAF --- duration of poststep: 0.001 s PDAF Forecast ------------------------------------------------------- 6 Next observation at time step 8 PDAF Evolve state ensemble @@ -300,10 +300,10 @@ F = final function value CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL - Total User time 9.000E-05 seconds. + Total User time 8.200E-05 seconds. PDAF --- Exit optimization, status CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL -PDAF --- update duration: 0.000 s +PDAF --- update duration: 0.001 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 @@ -320,7 +320,7 @@ PDAF Call pre-post routine after forecast; step 10 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.002 s +PDAF --- duration of prestep: 0.001 s PDAF Analysis ------------------------------------------------------- PDAF 10 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: LBFGS @@ -355,10 +355,10 @@ F = final function value CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL - Total User time 8.400E-05 seconds. + Total User time 7.799E-05 seconds. PDAF --- Exit optimization, status CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL -PDAF --- update duration: 0.000 s +PDAF --- update duration: 0.001 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 @@ -375,7 +375,7 @@ PDAF Call pre-post routine after forecast; step 12 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.001 s +PDAF --- duration of prestep: 0.002 s PDAF Analysis ------------------------------------------------------- PDAF 12 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: LBFGS @@ -410,15 +410,15 @@ F = final function value CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL - Total User time 6.100E-05 seconds. + Total User time 8.300E-05 seconds. PDAF --- Exit optimization, status CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL -PDAF --- update duration: 0.001 s +PDAF --- update duration: 0.000 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.001 s +PDAF --- duration of poststep: 0.002 s PDAF Forecast ------------------------------------------------------- 12 Next observation at time step 14 PDAF Evolve state ensemble @@ -465,7 +465,7 @@ F = final function value CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL - Total User time 9.300E-05 seconds. + Total User time 1.030E-04 seconds. PDAF --- Exit optimization, status CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL PDAF --- update duration: 0.001 s @@ -485,7 +485,7 @@ PDAF Call pre-post routine after forecast; step 16 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.002 s +PDAF --- duration of prestep: 0.001 s PDAF Analysis ------------------------------------------------------- PDAF 16 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: LBFGS @@ -520,15 +520,15 @@ F = final function value CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL - Total User time 7.300E-05 seconds. + Total User time 8.200E-05 seconds. PDAF --- Exit optimization, status CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL -PDAF --- update duration: 0.000 s +PDAF --- update duration: 0.001 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.003 s +PDAF --- duration of poststep: 0.001 s PDAF Forecast ------------------------------------------------------- 16 Next observation at time step 18 PDAF Evolve state ensemble @@ -540,7 +540,7 @@ PDAF Call pre-post routine after forecast; step 18 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.003 s +PDAF --- duration of prestep: 0.002 s PDAF Analysis ------------------------------------------------------- PDAF 18 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: LBFGS @@ -575,7 +575,7 @@ F = final function value CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL - Total User time 1.380E-04 seconds. + Total User time 7.600E-05 seconds. PDAF --- Exit optimization, status CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL PDAF --- update duration: 0.001 s @@ -583,7 +583,7 @@ PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.002 s +PDAF --- duration of poststep: 0.001 s PDAF Forecast ------------------------------------------------------- 18 No more observations - end assimilation @@ -598,20 +598,20 @@ PDAF analysis step: 0.015 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- PDAF Initialize PDAF: 0.003 s -PDAF init_ens_pdaf: 0.003 s +PDAF init_ens_pdaf: 0.002 s PDAF State forecast: 0.000 s PDAF MPI communication in PDAF: 0.000 s PDAF distribute_state_pdaf: 0.000 s PDAF collect_state_pdaf: 0.000 s -PDAF 3DVAR analysis: 0.004 s -PDAF PDAF-internal operations: 0.000 s -PDAF OMI-internal routines: 0.001 s -PDAF Solver: 0.000 s +PDAF 3DVAR analysis: 0.007 s +PDAF PDAF-internal operations: 0.001 s +PDAF OMI-internal routines: 0.000 s +PDAF Solver: 0.001 s PDAF cvt_pdaf: 0.000 s PDAF cvt_adj_pdaf: 0.000 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.003 s +PDAF init_dim_obs_pdafomi: 0.005 s PDAF obs_op_pdafomi: 0.000 s PDAF obs_op_lin_pdafomi: 0.000 s PDAF obs_op_adj_pdafomi: 0.000 s -PDAF prepoststep_pdaf: 0.031 s +PDAF prepoststep_pdaf: 0.024 s diff --git a/tutorial/verification/out.online_2D_serial_3dv_opt2 b/tutorial/verification/out.online_2D_serial_3dv_opt2 index a8414bea5..866d6cb7b 100644 --- a/tutorial/verification/out.online_2D_serial_3dv_opt2 +++ b/tutorial/verification/out.online_2D_serial_3dv_opt2 @@ -32,7 +32,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -78,7 +78,7 @@ PDAF: Call routine for ensemble initialization Initialize B^1/2 PDAF: Initialization completed -PDAF --- duration of PDAF initialization: 0.005 s +PDAF --- duration of PDAF initialization: 0.002 s PDAF ---------------------------------------------------------------- @@ -100,7 +100,7 @@ PDAF Call pre-post routine after forecast; step 2 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.004 s +PDAF --- duration of prestep: 0.002 s PDAF Analysis ------------------------------------------------------- PDAF 2 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: CG+ @@ -125,7 +125,7 @@ INITIAL VALUES: SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 -PDAF --- update duration: 0.001 s +PDAF --- update duration: 0.000 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 @@ -167,7 +167,7 @@ INITIAL VALUES: SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 -PDAF --- update duration: 0.001 s +PDAF --- update duration: 0.000 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 @@ -184,7 +184,7 @@ PDAF Call pre-post routine after forecast; step 6 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.002 s +PDAF --- duration of prestep: 0.001 s PDAF Analysis ------------------------------------------------------- PDAF 6 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: CG+ @@ -214,7 +214,7 @@ PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.002 s +PDAF --- duration of poststep: 0.001 s PDAF Forecast ------------------------------------------------------- 6 Next observation at time step 8 PDAF Evolve state ensemble @@ -226,7 +226,7 @@ PDAF Call pre-post routine after forecast; step 8 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.003 s +PDAF --- duration of prestep: 0.002 s PDAF Analysis ------------------------------------------------------- PDAF 8 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: CG+ @@ -251,12 +251,12 @@ INITIAL VALUES: SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 -PDAF --- update duration: 0.001 s +PDAF --- update duration: 0.000 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.003 s +PDAF --- duration of poststep: 0.001 s PDAF Forecast ------------------------------------------------------- 8 Next observation at time step 10 PDAF Evolve state ensemble @@ -268,7 +268,7 @@ PDAF Call pre-post routine after forecast; step 10 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.003 s +PDAF --- duration of prestep: 0.002 s PDAF Analysis ------------------------------------------------------- PDAF 10 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: CG+ @@ -293,12 +293,12 @@ INITIAL VALUES: SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 -PDAF --- update duration: 0.001 s +PDAF --- update duration: 0.000 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.002 s +PDAF --- duration of poststep: 0.001 s PDAF Forecast ------------------------------------------------------- 10 Next observation at time step 12 PDAF Evolve state ensemble @@ -310,7 +310,7 @@ PDAF Call pre-post routine after forecast; step 12 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.003 s +PDAF --- duration of prestep: 0.002 s PDAF Analysis ------------------------------------------------------- PDAF 12 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: CG+ @@ -335,7 +335,7 @@ INITIAL VALUES: SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 -PDAF --- update duration: 0.000 s +PDAF --- update duration: 0.001 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 @@ -352,7 +352,7 @@ PDAF Call pre-post routine after forecast; step 14 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.001 s +PDAF --- duration of prestep: 0.002 s PDAF Analysis ------------------------------------------------------- PDAF 14 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: CG+ @@ -373,7 +373,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 1.331D+01 3.334D+00 1.3D-01 4.2D-01 - 2 5 1.311D+01 1.167D-08 3.5D-02 7.8D-16 + 2 5 1.311D+01 1.167D-08 3.5D-02 -6.4D-16 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -382,7 +382,7 @@ PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.001 s +PDAF --- duration of poststep: 0.002 s PDAF Forecast ------------------------------------------------------- 14 Next observation at time step 16 PDAF Evolve state ensemble @@ -394,7 +394,7 @@ PDAF Call pre-post routine after forecast; step 16 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.002 s +PDAF --- duration of prestep: 0.003 s PDAF Analysis ------------------------------------------------------- PDAF 16 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: CG+ @@ -415,16 +415,16 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 1.746D+01 1.029D+00 3.4D-02 7.8D-02 - 2 5 1.739D+01 1.646D-08 1.4D-01 -4.2D-15 + 2 5 1.739D+01 1.646D-08 1.4D-01 5.8D-15 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 -PDAF --- update duration: 0.001 s +PDAF --- update duration: 0.000 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.001 s +PDAF --- duration of poststep: 0.002 s PDAF Forecast ------------------------------------------------------- 16 Next observation at time step 18 PDAF Evolve state ensemble @@ -436,7 +436,7 @@ PDAF Call pre-post routine after forecast; step 18 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.002 s +PDAF --- duration of prestep: 0.003 s PDAF Analysis ------------------------------------------------------- PDAF 18 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: CG+ @@ -457,7 +457,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 2.272D+01 2.596D+00 4.1D-02 2.4D-01 - 2 5 2.234D+01 2.600D-08 1.1D-01 -1.7D-16 + 2 5 2.234D+01 2.600D-08 1.1D-01 -1.2D-15 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -466,7 +466,7 @@ PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.001 s +PDAF --- duration of poststep: 0.003 s PDAF Forecast ------------------------------------------------------- 18 No more observations - end assimilation @@ -480,21 +480,21 @@ PDAF analysis step: 0.011 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- -PDAF Initialize PDAF: 0.005 s -PDAF init_ens_pdaf: 0.005 s +PDAF Initialize PDAF: 0.002 s +PDAF init_ens_pdaf: 0.002 s PDAF State forecast: 0.000 s PDAF MPI communication in PDAF: 0.000 s PDAF distribute_state_pdaf: 0.000 s PDAF collect_state_pdaf: 0.000 s -PDAF 3DVAR analysis: 0.007 s -PDAF PDAF-internal operations: 0.000 s -PDAF OMI-internal routines: 0.002 s -PDAF Solver: 0.001 s +PDAF 3DVAR analysis: 0.003 s +PDAF PDAF-internal operations: 0.001 s +PDAF OMI-internal routines: 0.000 s +PDAF Solver: 0.000 s PDAF cvt_pdaf: 0.000 s PDAF cvt_adj_pdaf: 0.001 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.004 s +PDAF init_dim_obs_pdafomi: 0.001 s PDAF obs_op_pdafomi: 0.000 s PDAF obs_op_lin_pdafomi: 0.000 s PDAF obs_op_adj_pdafomi: 0.000 s -PDAF prepoststep_pdaf: 0.038 s +PDAF prepoststep_pdaf: 0.035 s diff --git a/tutorial/verification/out.online_2D_serial_3dv_opt3 b/tutorial/verification/out.online_2D_serial_3dv_opt3 index 8df911fd8..4b8a80509 100644 --- a/tutorial/verification/out.online_2D_serial_3dv_opt3 +++ b/tutorial/verification/out.online_2D_serial_3dv_opt3 @@ -32,7 +32,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -95,12 +95,12 @@ PDAF Evolve state ensemble step 1 step 2 PDAF Perform assimilation with PDAF -PDAF --- duration of forecast phase: 0.001 s +PDAF --- duration of forecast phase: 0.000 s PDAF Call pre-post routine after forecast; step 2 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.001 s +PDAF --- duration of prestep: 0.002 s PDAF Analysis ------------------------------------------------------- PDAF 2 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: plain CG @@ -119,7 +119,7 @@ PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.002 s +PDAF --- duration of poststep: 0.001 s PDAF Forecast ------------------------------------------------------- 2 Next observation at time step 4 PDAF Evolve state ensemble @@ -176,12 +176,12 @@ PDAF --- CG solver converged PDAF iter eps F PDAF 4 3.553E-15 1.947E+01 -PDAF --- update duration: 0.001 s +PDAF --- update duration: 0.000 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.001 s +PDAF --- duration of poststep: 0.002 s PDAF Forecast ------------------------------------------------------- 6 Next observation at time step 8 PDAF Evolve state ensemble @@ -207,12 +207,12 @@ PDAF --- CG solver converged PDAF iter eps F PDAF 4 3.553E-15 9.365E+00 -PDAF --- update duration: 0.001 s +PDAF --- update duration: 0.000 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.001 s +PDAF --- duration of poststep: 0.002 s PDAF Forecast ------------------------------------------------------- 8 Next observation at time step 10 PDAF Evolve state ensemble @@ -224,7 +224,7 @@ PDAF Call pre-post routine after forecast; step 10 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.002 s +PDAF --- duration of prestep: 0.001 s PDAF Analysis ------------------------------------------------------- PDAF 10 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: plain CG @@ -269,7 +269,7 @@ PDAF --- CG solver converged PDAF iter eps F PDAF 4 1.776E-15 1.393E+01 -PDAF --- update duration: 0.001 s +PDAF --- update duration: 0.000 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 @@ -300,12 +300,12 @@ PDAF --- CG solver converged PDAF iter eps F PDAF 4 3.553E-15 1.311E+01 -PDAF --- update duration: 0.001 s +PDAF --- update duration: 0.000 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.002 s +PDAF --- duration of poststep: 0.003 s PDAF Forecast ------------------------------------------------------- 14 Next observation at time step 16 PDAF Evolve state ensemble @@ -317,7 +317,7 @@ PDAF Call pre-post routine after forecast; step 16 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.003 s +PDAF --- duration of prestep: 0.002 s PDAF Analysis ------------------------------------------------------- PDAF 16 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: plain CG @@ -348,7 +348,7 @@ PDAF Call pre-post routine after forecast; step 18 Analyze and write forecasted state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.003 s +PDAF --- duration of prestep: 0.002 s PDAF Analysis ------------------------------------------------------- PDAF 18 Assimilating observations - 3DVAR incremental, transformed PDAF --- solver: plain CG @@ -362,12 +362,12 @@ PDAF --- CG solver converged PDAF iter eps F PDAF 4 0.000E+00 2.234E+01 -PDAF --- update duration: 0.000 s +PDAF --- update duration: 0.001 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state for 3D-Var RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.002 s +PDAF --- duration of poststep: 0.003 s PDAF Forecast ------------------------------------------------------- 18 No more observations - end assimilation @@ -383,19 +383,19 @@ PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- PDAF Initialize PDAF: 0.002 s PDAF init_ens_pdaf: 0.002 s -PDAF State forecast: 0.001 s +PDAF State forecast: 0.000 s PDAF MPI communication in PDAF: 0.000 s PDAF distribute_state_pdaf: 0.000 s PDAF collect_state_pdaf: 0.000 s -PDAF 3DVAR analysis: 0.005 s -PDAF PDAF-internal operations: 0.001 s -PDAF OMI-internal routines: 0.001 s +PDAF 3DVAR analysis: 0.002 s +PDAF PDAF-internal operations: 0.000 s +PDAF OMI-internal routines: 0.000 s PDAF Solver: 0.000 s PDAF cvt_pdaf: 0.000 s PDAF cvt_adj_pdaf: 0.000 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.003 s -PDAF obs_op_pdafomi: 0.001 s +PDAF init_dim_obs_pdafomi: 0.002 s +PDAF obs_op_pdafomi: 0.000 s PDAF obs_op_lin_pdafomi: 0.000 s PDAF obs_op_adj_pdafomi: 0.000 s -PDAF prepoststep_pdaf: 0.032 s +PDAF prepoststep_pdaf: 0.033 s diff --git a/tutorial/verification/out.online_2D_serialmodel b/tutorial/verification/out.online_2D_serialmodel index 2d33e8314..25ec23a98 100644 --- a/tutorial/verification/out.online_2D_serialmodel +++ b/tutorial/verification/out.online_2D_serialmodel @@ -49,9 +49,6 @@ Time steps 18 INITIALIZE PDAF - ONLINE MODE - INITIALIZE 2D TUTORIAL MODEL - Grid size: 36 x 18 - Time steps 18 PARSER: screen= 1 PARSER: dim_ens= 9 PARSER: filtertype= 7 @@ -65,7 +62,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -95,6 +92,9 @@ PDAF --> Standard LESTKF PDAF --> Transform ensemble with deterministic Omega PDAF --> Use fixed forgetting factor: 1.00 PDAF --> ensemble size: 9 + INITIALIZE 2D TUTORIAL MODEL + Grid size: 36 x 18 + Time steps 18 PDAF: Initialize Parallelization PDAF Parallelization - Filter on model PEs: @@ -531,21 +531,19 @@ PDAF analysis step: 0.020 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- -PDAF Initialize PDAF: 0.010 s -PDAF init_ens_pdaf: 0.004 s -PDAF Ensemble forecast: 0.125 s -PDAF MPI communication in PDAF: 0.125 s +PDAF Initialize PDAF: 0.012 s +PDAF init_ens_pdaf: 0.005 s +PDAF Ensemble forecast: 0.162 s +PDAF MPI communication in PDAF: 0.162 s PDAF distribute_state_pdaf: 0.000 s PDAF collect_state_pdaf: 0.000 s -PDAF LESTKF analysis: 0.035 s -PDAF PDAF-internal operations: 0.008 s -PDAF OMI-internal routines: 0.010 s +PDAF LESTKF analysis: 0.024 s +PDAF PDAF-internal operations: 0.007 s +PDAF OMI-internal routines: 0.000 s PDAF init_n_domains_pdaf: 0.000 s -PDAF init_dim_l_pdaf: 0.000 s -PDAF g2l_state_pdaf: 0.000 s -PDAF l2g_state_pdaf: 0.004 s +PDAF init_dim_l_pdaf: 0.001 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.007 s -PDAF obs_op_pdafomi: 0.001 s -PDAF init_dim_obs_l_pdafomi: 0.013 s -PDAF prepoststep_pdaf: 0.180 s +PDAF init_dim_obs_pdafomi: 0.006 s +PDAF obs_op_pdafomi: 0.000 s +PDAF init_dim_obs_l_pdafomi: 0.005 s +PDAF prepoststep_pdaf: 0.279 s diff --git a/tutorial/verification/out.online_2D_serialmodel_2fields b/tutorial/verification/out.online_2D_serialmodel_2fields index b450e2e29..aa185d933 100644 --- a/tutorial/verification/out.online_2D_serialmodel_2fields +++ b/tutorial/verification/out.online_2D_serialmodel_2fields @@ -6,13 +6,13 @@ world filter model couple filterPE rank rank task rank task rank T/F ---------------------------------------------------------- - 6 7 0 1 6 F - 5 6 0 1 5 F 3 4 0 1 3 F - 7 8 0 1 7 F - 1 2 0 1 1 F + 5 6 0 1 5 F + 6 7 0 1 6 F 4 5 0 1 4 F 2 3 0 1 2 F + 1 2 0 1 1 F + 7 8 0 1 7 F 8 9 0 1 8 F 0 0 1 0 1 0 T INITIALIZE 2D-2FIELDS TUTORIAL MODEL @@ -65,7 +65,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -531,21 +531,19 @@ PDAF analysis step: 0.020 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- -PDAF Initialize PDAF: 0.014 s -PDAF init_ens_pdaf: 0.009 s -PDAF Ensemble forecast: 0.079 s -PDAF MPI communication in PDAF: 0.078 s +PDAF Initialize PDAF: 0.013 s +PDAF init_ens_pdaf: 0.007 s +PDAF Ensemble forecast: 0.133 s +PDAF MPI communication in PDAF: 0.133 s PDAF distribute_state_pdaf: 0.000 s PDAF collect_state_pdaf: 0.000 s -PDAF LESTKF analysis: 0.055 s -PDAF PDAF-internal operations: 0.013 s -PDAF OMI-internal routines: 0.017 s +PDAF LESTKF analysis: 0.037 s +PDAF PDAF-internal operations: 0.008 s +PDAF OMI-internal routines: 0.000 s PDAF init_n_domains_pdaf: 0.000 s -PDAF init_dim_l_pdaf: 0.002 s -PDAF g2l_state_pdaf: 0.002 s -PDAF l2g_state_pdaf: 0.001 s +PDAF init_dim_l_pdaf: 0.001 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.007 s +PDAF init_dim_obs_pdafomi: 0.004 s PDAF obs_op_pdafomi: 0.000 s -PDAF init_dim_obs_l_pdafomi: 0.027 s -PDAF prepoststep_pdaf: 0.384 s +PDAF init_dim_obs_l_pdafomi: 0.011 s +PDAF prepoststep_pdaf: 0.411 s diff --git a/tutorial/verification/out.online_2D_serialmodel_2fields_ESTKF b/tutorial/verification/out.online_2D_serialmodel_2fields_ESTKF index e9fb10054..896e22edd 100644 --- a/tutorial/verification/out.online_2D_serialmodel_2fields_ESTKF +++ b/tutorial/verification/out.online_2D_serialmodel_2fields_ESTKF @@ -65,7 +65,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -403,16 +403,16 @@ PDAF analysis step: 0.032 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- -PDAF Initialize PDAF: 0.013 s -PDAF init_ens_pdaf: 0.007 s -PDAF Ensemble forecast: 0.083 s -PDAF MPI communication in PDAF: 0.083 s +PDAF Initialize PDAF: 0.014 s +PDAF init_ens_pdaf: 0.008 s +PDAF Ensemble forecast: 0.137 s +PDAF MPI communication in PDAF: 0.137 s PDAF distribute_state_pdaf: 0.000 s PDAF collect_state_pdaf: 0.000 s PDAF ESTKF analysis: 0.007 s -PDAF PDAF-internal operations: 0.001 s -PDAF OMI-internal routines: 0.009 s +PDAF PDAF-internal operations: 0.003 s +PDAF OMI-internal routines: 0.000 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.006 s +PDAF init_dim_obs_pdafomi: 0.004 s PDAF obs_op_pdafomi: 0.000 s -PDAF prepoststep_pdaf: 0.455 s +PDAF prepoststep_pdaf: 0.460 s diff --git a/tutorial/verification/out.online_2D_serialmodel_2fields_obsB b/tutorial/verification/out.online_2D_serialmodel_2fields_obsB index f4e4d511b..fbe3832c4 100644 --- a/tutorial/verification/out.online_2D_serialmodel_2fields_obsB +++ b/tutorial/verification/out.online_2D_serialmodel_2fields_obsB @@ -66,7 +66,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -174,13 +174,13 @@ PDAF Local domains without observations: 1278 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- analysis/re-init duration: 0.005 s +PDAF --- analysis/re-init duration: 0.004 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS errors according to sampled variance: 5.7431E-01 7.4275E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.020 s +PDAF --- duration of poststep: 0.022 s PDAF Forecast ------------------------------------------------------- 2 Next observation at time step 4 PDAF Evolve state ensemble @@ -189,13 +189,13 @@ PDAF --- Distribute sub-ensembles step 4 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.031 s PDAF Call pre-post routine after forecast; step 4 Analyze and write forecasted state ensemble --- compute ensemble mean RMS errors according to sampled variance: 5.7431E-01 7.4275E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.022 s +PDAF --- duration of prestep: 0.024 s PDAF Analysis ------------------------------------------------------- PDAF 4 Local ESTKF analysis PDAF --- local analysis domains: 1296 @@ -221,13 +221,13 @@ PDAF Local domains without observations: 1278 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- analysis/re-init duration: 0.005 s +PDAF --- analysis/re-init duration: 0.004 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS errors according to sampled variance: 5.7271E-01 7.3544E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.021 s +PDAF --- duration of poststep: 0.023 s PDAF Forecast ------------------------------------------------------- 4 Next observation at time step 6 PDAF Evolve state ensemble @@ -236,7 +236,7 @@ PDAF --- Distribute sub-ensembles step 6 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.009 s PDAF Call pre-post routine after forecast; step 6 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -268,13 +268,13 @@ PDAF Local domains without observations: 1278 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- analysis/re-init duration: 0.005 s +PDAF --- analysis/re-init duration: 0.004 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS errors according to sampled variance: 5.7064E-01 7.2804E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.021 s +PDAF --- duration of poststep: 0.023 s PDAF Forecast ------------------------------------------------------- 6 Next observation at time step 8 PDAF Evolve state ensemble @@ -283,13 +283,13 @@ PDAF --- Distribute sub-ensembles step 8 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.023 s +PDAF --- duration of forecast phase: 0.014 s PDAF Call pre-post routine after forecast; step 8 Analyze and write forecasted state ensemble --- compute ensemble mean RMS errors according to sampled variance: 5.7064E-01 7.2804E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.021 s +PDAF --- duration of prestep: 0.023 s PDAF Analysis ------------------------------------------------------- PDAF 8 Local ESTKF analysis PDAF --- local analysis domains: 1296 @@ -315,7 +315,7 @@ PDAF Local domains without observations: 1278 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- analysis/re-init duration: 0.005 s +PDAF --- analysis/re-init duration: 0.004 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean @@ -330,13 +330,13 @@ PDAF --- Distribute sub-ensembles step 10 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.011 s PDAF Call pre-post routine after forecast; step 10 Analyze and write forecasted state ensemble --- compute ensemble mean RMS errors according to sampled variance: 5.6792E-01 7.2058E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.021 s +PDAF --- duration of prestep: 0.022 s PDAF Analysis ------------------------------------------------------- PDAF 10 Local ESTKF analysis PDAF --- local analysis domains: 1296 @@ -362,7 +362,7 @@ PDAF Local domains without observations: 1278 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- analysis/re-init duration: 0.005 s +PDAF --- analysis/re-init duration: 0.004 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean @@ -377,7 +377,7 @@ PDAF --- Distribute sub-ensembles step 12 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.010 s +PDAF --- duration of forecast phase: 0.013 s PDAF Call pre-post routine after forecast; step 12 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -409,13 +409,13 @@ PDAF Local domains without observations: 1278 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- analysis/re-init duration: 0.005 s +PDAF --- analysis/re-init duration: 0.004 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS errors according to sampled variance: 5.6481E-01 7.1165E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.022 s +PDAF --- duration of poststep: 0.023 s PDAF Forecast ------------------------------------------------------- 12 Next observation at time step 14 PDAF Evolve state ensemble @@ -424,7 +424,7 @@ PDAF --- Distribute sub-ensembles step 14 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.000 s +PDAF --- duration of forecast phase: 0.005 s PDAF Call pre-post routine after forecast; step 14 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -456,13 +456,13 @@ PDAF Local domains without observations: 1278 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- analysis/re-init duration: 0.005 s +PDAF --- analysis/re-init duration: 0.004 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS errors according to sampled variance: 5.6348E-01 7.0819E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.023 s +PDAF --- duration of poststep: 0.024 s PDAF Forecast ------------------------------------------------------- 14 Next observation at time step 16 PDAF Evolve state ensemble @@ -471,13 +471,13 @@ PDAF --- Distribute sub-ensembles step 16 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.000 s +PDAF --- duration of forecast phase: 0.006 s PDAF Call pre-post routine after forecast; step 16 Analyze and write forecasted state ensemble --- compute ensemble mean RMS errors according to sampled variance: 5.6348E-01 7.0819E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.022 s +PDAF --- duration of prestep: 0.023 s PDAF Analysis ------------------------------------------------------- PDAF 16 Local ESTKF analysis PDAF --- local analysis domains: 1296 @@ -503,7 +503,7 @@ PDAF Local domains without observations: 1278 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- analysis/re-init duration: 0.005 s +PDAF --- analysis/re-init duration: 0.004 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean @@ -518,13 +518,13 @@ PDAF --- Distribute sub-ensembles step 18 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.000 s +PDAF --- duration of forecast phase: 0.005 s PDAF Call pre-post routine after forecast; step 18 Analyze and write forecasted state ensemble --- compute ensemble mean RMS errors according to sampled variance: 5.6270E-01 7.0471E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.039 s +PDAF --- duration of prestep: 0.022 s PDAF Analysis ------------------------------------------------------- PDAF 18 Local ESTKF analysis PDAF --- local analysis domains: 1296 @@ -550,13 +550,13 @@ PDAF Local domains without observations: 1278 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- analysis/re-init duration: 0.005 s +PDAF --- analysis/re-init duration: 0.004 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS errors according to sampled variance: 5.6210E-01 7.0121E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.021 s +PDAF --- duration of poststep: 0.023 s PDAF Forecast ------------------------------------------------------- 18 No more observations - end assimilation @@ -571,20 +571,18 @@ PDAF analysis step: 0.019 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- PDAF Initialize PDAF: 0.013 s -PDAF init_ens_pdaf: 0.008 s -PDAF Ensemble forecast: 0.064 s -PDAF MPI communication in PDAF: 0.064 s +PDAF init_ens_pdaf: 0.007 s +PDAF Ensemble forecast: 0.104 s +PDAF MPI communication in PDAF: 0.102 s PDAF distribute_state_pdaf: 0.000 s PDAF collect_state_pdaf: 0.000 s -PDAF LESTKF analysis: 0.045 s -PDAF PDAF-internal operations: 0.009 s -PDAF OMI-internal routines: 0.011 s +PDAF LESTKF analysis: 0.036 s +PDAF PDAF-internal operations: 0.003 s +PDAF OMI-internal routines: 0.002 s PDAF init_n_domains_pdaf: 0.000 s -PDAF init_dim_l_pdaf: 0.003 s -PDAF g2l_state_pdaf: 0.002 s -PDAF l2g_state_pdaf: 0.001 s +PDAF init_dim_l_pdaf: 0.004 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.006 s +PDAF init_dim_obs_pdafomi: 0.007 s PDAF obs_op_pdafomi: 0.000 s -PDAF init_dim_obs_l_pdafomi: 0.021 s -PDAF prepoststep_pdaf: 0.408 s +PDAF init_dim_obs_l_pdafomi: 0.011 s +PDAF prepoststep_pdaf: 0.407 s diff --git a/tutorial/verification/out.online_2D_serialmodel_3denvar_opt2 b/tutorial/verification/out.online_2D_serialmodel_3denvar_opt2 index 75aebc079..6f3048038 100644 --- a/tutorial/verification/out.online_2D_serialmodel_3denvar_opt2 +++ b/tutorial/verification/out.online_2D_serialmodel_3denvar_opt2 @@ -63,7 +63,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -136,7 +136,7 @@ PDAF --- Distribute sub-ensembles PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task START INTEGRATION -PDAF --- duration of forecast phase: 0.010 s +PDAF --- duration of forecast phase: 0.009 s PDAF Call pre-post routine after forecast; step 2 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -164,7 +164,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 5.187D+01 3.005D+01 7.7D-02 7.3D-01 - 2 5 2.490D+01 1.257D-08 6.0D-02 7.0D-16 + 2 5 2.490D+01 1.257D-08 6.0D-02 5.7D-16 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -179,7 +179,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 1.2745E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.010 s +PDAF --- duration of poststep: 0.011 s PDAF Forecast ------------------------------------------------------- 2 Next observation at time step 4 PDAF Evolve state ensemble @@ -194,7 +194,7 @@ PDAF Call pre-post routine after forecast; step 4 --- compute ensemble mean RMS error according to sampled variance: 1.2745E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.011 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 4 Assimilating observations - ensemble 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -240,7 +240,7 @@ PDAF --- Distribute sub-ensembles step 6 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.010 s +PDAF --- duration of forecast phase: 0.031 s PDAF Call pre-post routine after forecast; step 6 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -268,7 +268,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 1.954D+01 7.684D-04 6.8D-01 6.0D-06 - 2 5 1.954D+01 1.265D-09 6.7D-01 4.4D-12 + 2 5 1.954D+01 1.265D-09 6.7D-01 3.0D-13 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -283,7 +283,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 7.5872E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.010 s +PDAF --- duration of poststep: 0.013 s PDAF Forecast ------------------------------------------------------- 6 Next observation at time step 8 PDAF Evolve state ensemble @@ -292,13 +292,13 @@ PDAF --- Distribute sub-ensembles step 8 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.030 s PDAF Call pre-post routine after forecast; step 8 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 7.5872E-02 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.013 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 8 Assimilating observations - ensemble 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -320,7 +320,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 9.561D+00 1.504D-03 7.6D-01 1.3D-05 - 2 5 9.561D+00 8.059D-10 7.5D-01 1.3D-13 + 2 5 9.561D+00 8.059D-10 7.5D-01 3.3D-13 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -329,13 +329,13 @@ PDAF Perform ensemble transformation PDAF --- use symmetric square-root of A PDAF --- Compute deterministic Omega PDAF --- Ensemble update: use blocking with size 200 -PDAF --- duration of En3D-Var update: 0.000 s +PDAF --- duration of En3D-Var update: 0.001 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 6.5977E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.011 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 8 Next observation at time step 10 PDAF Evolve state ensemble @@ -344,13 +344,13 @@ PDAF --- Distribute sub-ensembles step 10 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.010 s PDAF Call pre-post routine after forecast; step 10 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 6.5977E-02 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.010 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 10 Assimilating observations - ensemble 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -386,7 +386,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 5.9158E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.011 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 10 Next observation at time step 12 PDAF Evolve state ensemble @@ -401,7 +401,7 @@ PDAF Call pre-post routine after forecast; step 12 --- compute ensemble mean RMS error according to sampled variance: 5.9158E-02 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.011 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 12 Assimilating observations - ensemble 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -432,13 +432,13 @@ PDAF Perform ensemble transformation PDAF --- use symmetric square-root of A PDAF --- Compute deterministic Omega PDAF --- Ensemble update: use blocking with size 200 -PDAF --- duration of En3D-Var update: 0.000 s +PDAF --- duration of En3D-Var update: 0.001 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.4093E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.010 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 12 Next observation at time step 14 PDAF Evolve state ensemble @@ -447,7 +447,7 @@ PDAF --- Distribute sub-ensembles step 14 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.014 s PDAF Call pre-post routine after forecast; step 14 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -475,7 +475,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 1.331D+01 3.299D-04 8.6D-01 5.2D-07 - 2 5 1.331D+01 3.566D-10 8.6D-01 -5.3D-11 + 2 5 1.331D+01 3.566D-10 8.6D-01 4.9D-12 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -490,7 +490,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 5.0140E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.011 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 14 Next observation at time step 16 PDAF Evolve state ensemble @@ -499,13 +499,13 @@ PDAF --- Distribute sub-ensembles step 16 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.012 s PDAF Call pre-post routine after forecast; step 16 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.0140E-02 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.010 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 16 Assimilating observations - ensemble 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -541,7 +541,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 4.6945E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.011 s +PDAF --- duration of poststep: 0.016 s PDAF Forecast ------------------------------------------------------- 16 Next observation at time step 18 PDAF Evolve state ensemble @@ -550,13 +550,13 @@ PDAF --- Distribute sub-ensembles step 18 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.021 s +PDAF --- duration of forecast phase: 0.018 s PDAF Call pre-post routine after forecast; step 18 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 4.6945E-02 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.011 s +PDAF --- duration of prestep: 0.013 s PDAF Analysis ------------------------------------------------------- PDAF 18 Assimilating observations - ensemble 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -592,7 +592,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 4.4291E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.011 s +PDAF --- duration of poststep: 0.013 s PDAF Forecast ------------------------------------------------------- 18 No more observations - end assimilation @@ -608,19 +608,19 @@ PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- PDAF Initialize PDAF: 0.010 s PDAF init_ens_pdaf: 0.004 s -PDAF Ensemble forecast: 0.093 s -PDAF MPI communication in PDAF: 0.093 s +PDAF Ensemble forecast: 0.148 s +PDAF MPI communication in PDAF: 0.148 s PDAF distribute_state_pdaf: 0.000 s PDAF collect_state_pdaf: 0.000 s -PDAF Hyb3DVAR analysis: 0.000 s -PDAF PDAF-internal operations: 0.000 s -PDAF OMI-internal routines: 0.014 s -PDAF Solver: 0.002 s +PDAF Hyb3DVAR analysis: 0.004 s +PDAF PDAF-internal operations: 0.002 s +PDAF OMI-internal routines: 0.000 s +PDAF Solver: 0.000 s PDAF cvt_ens_pdaf: 0.000 s PDAF cvt_ens_adj_pdaf: 0.000 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.005 s +PDAF init_dim_obs_pdafomi: 0.004 s PDAF obs_op_pdafomi: 0.000 s -PDAF obs_op_lin_pdafomi: 0.001 s +PDAF obs_op_lin_pdafomi: 0.000 s PDAF obs_op_adj_pdafomi: 0.000 s -PDAF prepoststep_pdaf: 0.196 s +PDAF prepoststep_pdaf: 0.219 s diff --git a/tutorial/verification/out.online_2D_serialmodel_3denvar_opt3 b/tutorial/verification/out.online_2D_serialmodel_3denvar_opt3 index 100d8a858..29709c7a4 100644 --- a/tutorial/verification/out.online_2D_serialmodel_3denvar_opt3 +++ b/tutorial/verification/out.online_2D_serialmodel_3denvar_opt3 @@ -63,7 +63,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -108,7 +108,7 @@ PDAF: Call routine for ensemble initialization --- Ensemble size: 9 PDAF: Initialization completed -PDAF --- duration of PDAF initialization: 0.010 s +PDAF --- duration of PDAF initialization: 0.009 s PDAF ---------------------------------------------------------------- @@ -118,7 +118,7 @@ PDAF Call pre-post routine at initial time Analyze initial state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.7637E-01 -PDAF --- duration of prestep: 0.000 s +PDAF --- duration of prestep: 0.001 s PDAF Forecast ------------------------------------------------------- 0 Next observation at time step 2 PDAF Evolve state ensemble @@ -136,13 +136,13 @@ PDAF --- Distribute sub-ensembles PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task START INTEGRATION -PDAF --- duration of forecast phase: 0.010 s +PDAF --- duration of forecast phase: 0.008 s PDAF Call pre-post routine after forecast; step 2 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.012 s +PDAF --- duration of prestep: 0.011 s PDAF Analysis ------------------------------------------------------- PDAF 2 Assimilating observations - ensemble 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -162,13 +162,13 @@ PDAF Perform ensemble transformation PDAF --- use symmetric square-root of A PDAF --- Compute deterministic Omega PDAF --- Ensemble update: use blocking with size 200 -PDAF --- duration of En3D-Var update: 0.001 s +PDAF --- duration of En3D-Var update: 0.000 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 1.2745E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.012 s +PDAF --- duration of poststep: 0.011 s PDAF Forecast ------------------------------------------------------- 2 Next observation at time step 4 PDAF Evolve state ensemble @@ -177,7 +177,7 @@ PDAF --- Distribute sub-ensembles step 4 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.009 s +PDAF --- duration of forecast phase: 0.007 s PDAF Call pre-post routine after forecast; step 4 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -209,7 +209,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 9.2179E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.013 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 4 Next observation at time step 6 PDAF Evolve state ensemble @@ -218,13 +218,13 @@ PDAF --- Distribute sub-ensembles step 6 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.006 s +PDAF --- duration of forecast phase: 0.041 s PDAF Call pre-post routine after forecast; step 6 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 9.2179E-02 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.012 s +PDAF --- duration of prestep: 0.013 s PDAF Analysis ------------------------------------------------------- PDAF 6 Assimilating observations - ensemble 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -259,7 +259,7 @@ PDAF --- Distribute sub-ensembles step 8 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.010 s PDAF Call pre-post routine after forecast; step 8 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -300,7 +300,7 @@ PDAF --- Distribute sub-ensembles step 10 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.019 s +PDAF --- duration of forecast phase: 0.009 s PDAF Call pre-post routine after forecast; step 10 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -332,7 +332,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 5.9158E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.011 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 10 Next observation at time step 12 PDAF Evolve state ensemble @@ -341,7 +341,7 @@ PDAF --- Distribute sub-ensembles step 12 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.022 s +PDAF --- duration of forecast phase: 0.009 s PDAF Call pre-post routine after forecast; step 12 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -373,7 +373,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 5.4093E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.012 s +PDAF --- duration of poststep: 0.011 s PDAF Forecast ------------------------------------------------------- 12 Next observation at time step 14 PDAF Evolve state ensemble @@ -382,13 +382,13 @@ PDAF --- Distribute sub-ensembles step 14 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.012 s PDAF Call pre-post routine after forecast; step 14 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.4093E-02 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.015 s +PDAF --- duration of prestep: 0.013 s PDAF Analysis ------------------------------------------------------- PDAF 14 Assimilating observations - ensemble 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -408,13 +408,13 @@ PDAF Perform ensemble transformation PDAF --- use symmetric square-root of A PDAF --- Compute deterministic Omega PDAF --- Ensemble update: use blocking with size 200 -PDAF --- duration of En3D-Var update: 0.001 s +PDAF --- duration of En3D-Var update: 0.000 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.0140E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.012 s +PDAF --- duration of poststep: 0.013 s PDAF Forecast ------------------------------------------------------- 14 Next observation at time step 16 PDAF Evolve state ensemble @@ -423,13 +423,13 @@ PDAF --- Distribute sub-ensembles step 16 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.019 s PDAF Call pre-post routine after forecast; step 16 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.0140E-02 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.013 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 16 Assimilating observations - ensemble 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -455,7 +455,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 4.6945E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.014 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 16 Next observation at time step 18 PDAF Evolve state ensemble @@ -464,7 +464,7 @@ PDAF --- Distribute sub-ensembles step 18 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.013 s +PDAF --- duration of forecast phase: 0.014 s PDAF Call pre-post routine after forecast; step 18 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -510,21 +510,21 @@ PDAF analysis step: 0.033 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- -PDAF Initialize PDAF: 0.010 s -PDAF init_ens_pdaf: 0.004 s -PDAF Ensemble forecast: 0.100 s -PDAF MPI communication in PDAF: 0.100 s +PDAF Initialize PDAF: 0.009 s +PDAF init_ens_pdaf: 0.003 s +PDAF Ensemble forecast: 0.129 s +PDAF MPI communication in PDAF: 0.129 s PDAF distribute_state_pdaf: 0.000 s PDAF collect_state_pdaf: 0.000 s -PDAF Hyb3DVAR analysis: 0.006 s -PDAF PDAF-internal operations: 0.003 s -PDAF OMI-internal routines: 0.011 s +PDAF Hyb3DVAR analysis: 0.002 s +PDAF PDAF-internal operations: 0.001 s +PDAF OMI-internal routines: 0.001 s PDAF Solver: 0.000 s -PDAF cvt_ens_pdaf: 0.000 s +PDAF cvt_ens_pdaf: 0.001 s PDAF cvt_ens_adj_pdaf: 0.000 s PDAF Time in OMI observation module routines PDAF init_dim_obs_pdafomi: 0.004 s PDAF obs_op_pdafomi: 0.000 s PDAF obs_op_lin_pdafomi: 0.000 s PDAF obs_op_adj_pdafomi: 0.000 s -PDAF prepoststep_pdaf: 0.226 s +PDAF prepoststep_pdaf: 0.221 s diff --git a/tutorial/verification/out.online_2D_serialmodel_3dhybvar_opt2 b/tutorial/verification/out.online_2D_serialmodel_3dhybvar_opt2 index 61af47c48..ffe92e398 100644 --- a/tutorial/verification/out.online_2D_serialmodel_3dhybvar_opt2 +++ b/tutorial/verification/out.online_2D_serialmodel_3dhybvar_opt2 @@ -53,10 +53,10 @@ PARSER: filtertype= 200 PARSER: subtype= 7 PARSER: type_opt= 2 - PARSER: dim_cvec= 9 INITIALIZE 2D TUTORIAL MODEL Grid size: 36 x 18 Time steps 18 + PARSER: dim_cvec= 9 Assimilation using 3D-Var -- Hybrid 3D-Var using ESTKF for ensemble transformation @@ -64,7 +64,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -112,7 +112,7 @@ PDAF: Call routine for ensemble initialization Initialize B^1/2 for 3D-Var PDAF: Initialization completed -PDAF --- duration of PDAF initialization: 0.010 s +PDAF --- duration of PDAF initialization: 0.009 s PDAF ---------------------------------------------------------------- @@ -140,7 +140,7 @@ PDAF --- Distribute sub-ensembles PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task START INTEGRATION -PDAF --- duration of forecast phase: 0.010 s +PDAF --- duration of forecast phase: 0.009 s PDAF Call pre-post routine after forecast; step 2 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -184,7 +184,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 1.2745E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.012 s +PDAF --- duration of poststep: 0.011 s PDAF Forecast ------------------------------------------------------- 2 Next observation at time step 4 PDAF Evolve state ensemble @@ -193,7 +193,7 @@ PDAF --- Distribute sub-ensembles step 4 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.015 s PDAF Call pre-post routine after forecast; step 4 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -237,7 +237,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 9.2179E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.012 s +PDAF --- duration of poststep: 0.013 s PDAF Forecast ------------------------------------------------------- 4 Next observation at time step 6 PDAF Evolve state ensemble @@ -246,7 +246,7 @@ PDAF --- Distribute sub-ensembles step 6 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.017 s +PDAF --- duration of forecast phase: 0.041 s PDAF Call pre-post routine after forecast; step 6 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -290,7 +290,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 7.5872E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.011 s +PDAF --- duration of poststep: 0.014 s PDAF Forecast ------------------------------------------------------- 6 Next observation at time step 8 PDAF Evolve state ensemble @@ -299,13 +299,13 @@ PDAF --- Distribute sub-ensembles step 8 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.023 s +PDAF --- duration of forecast phase: 0.041 s PDAF Call pre-post routine after forecast; step 8 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 7.5872E-02 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.012 s +PDAF --- duration of prestep: 0.013 s PDAF Analysis ------------------------------------------------------- PDAF 8 Assimilating observations - hybrid 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -343,7 +343,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 6.5977E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.011 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 8 Next observation at time step 10 PDAF Evolve state ensemble @@ -352,13 +352,13 @@ PDAF --- Distribute sub-ensembles step 10 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.042 s PDAF Call pre-post routine after forecast; step 10 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 6.5977E-02 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.013 s +PDAF --- duration of prestep: 0.014 s PDAF Analysis ------------------------------------------------------- PDAF 10 Assimilating observations - hybrid 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -405,7 +405,7 @@ PDAF --- Distribute sub-ensembles step 12 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.006 s +PDAF --- duration of forecast phase: 0.011 s PDAF Call pre-post routine after forecast; step 12 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -449,7 +449,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 5.4093E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.015 s +PDAF --- duration of poststep: 0.013 s PDAF Forecast ------------------------------------------------------- 12 Next observation at time step 14 PDAF Evolve state ensemble @@ -458,7 +458,7 @@ PDAF --- Distribute sub-ensembles step 14 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.011 s +PDAF --- duration of forecast phase: 0.016 s PDAF Call pre-post routine after forecast; step 14 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -511,7 +511,7 @@ PDAF --- Distribute sub-ensembles step 16 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.021 s +PDAF --- duration of forecast phase: 0.012 s PDAF Call pre-post routine after forecast; step 16 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -555,7 +555,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 4.6945E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.013 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 16 Next observation at time step 18 PDAF Evolve state ensemble @@ -564,13 +564,13 @@ PDAF --- Distribute sub-ensembles step 18 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.023 s +PDAF --- duration of forecast phase: 0.014 s PDAF Call pre-post routine after forecast; step 18 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 4.6945E-02 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.016 s +PDAF --- duration of prestep: 0.013 s PDAF Analysis ------------------------------------------------------- PDAF 18 Assimilating observations - hybrid 3DVAR with ESTKF PDAF Step 1: Update state estimate with variational solver @@ -608,7 +608,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 4.4291E-02 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.015 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 18 No more observations - end assimilation @@ -622,21 +622,21 @@ PDAF analysis step: 0.038 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- -PDAF Initialize PDAF: 0.010 s +PDAF Initialize PDAF: 0.009 s PDAF init_ens_pdaf: 0.004 s -PDAF Ensemble forecast: 0.125 s -PDAF MPI communication in PDAF: 0.125 s +PDAF Ensemble forecast: 0.201 s +PDAF MPI communication in PDAF: 0.201 s PDAF distribute_state_pdaf: 0.000 s PDAF collect_state_pdaf: 0.000 s PDAF Hyb3DVAR analysis: 0.002 s PDAF PDAF-internal operations: 0.001 s -PDAF OMI-internal routines: 0.013 s -PDAF Solver: 0.002 s -PDAF cvt_ens_pdaf: 0.001 s -PDAF cvt_ens_adj_pdaf: 0.000 s +PDAF OMI-internal routines: 0.000 s +PDAF Solver: 0.003 s +PDAF cvt_ens_pdaf: 0.000 s +PDAF cvt_ens_adj_pdaf: 0.001 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.002 s +PDAF init_dim_obs_pdafomi: 0.003 s PDAF obs_op_pdafomi: 0.000 s PDAF obs_op_lin_pdafomi: 0.000 s PDAF obs_op_adj_pdafomi: 0.000 s -PDAF prepoststep_pdaf: 0.228 s +PDAF prepoststep_pdaf: 0.225 s diff --git a/tutorial/verification/out.online_2D_serialmodel_3dlenvar_opt2 b/tutorial/verification/out.online_2D_serialmodel_3dlenvar_opt2 index 8b2d70972..4be763353 100644 --- a/tutorial/verification/out.online_2D_serialmodel_3dlenvar_opt2 +++ b/tutorial/verification/out.online_2D_serialmodel_3dlenvar_opt2 @@ -44,6 +44,9 @@ Tutorial: 2D model without parallelization + INITIALIZE 2D TUTORIAL MODEL + Grid size: 36 x 18 + Time steps 18 INITIALIZE 2D TUTORIAL MODEL Grid size: 36 x 18 Time steps 18 @@ -60,20 +63,17 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ PDAF +++ 2013, 55, 110-118, doi:10.1016/j.cageo.2012.03.026 +++ PDAF +++ when publishing work resulting from using PDAF +++ - INITIALIZE 2D TUTORIAL MODEL - Grid size: 36 x 18 PDAF +++ +++ PDAF +++ PDAF itself can also be cited as +++ PDAF +++ L. Nerger. Parallel Data Assimilation Framework +++ PDAF +++ (PDAF). Zenodo. 2024. doi:10.5281/zenodo.7861812 +++ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - Time steps 18 PDAF: Initialize filter @@ -137,7 +137,7 @@ PDAF --- Distribute sub-ensembles PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task START INTEGRATION -PDAF --- duration of forecast phase: 0.010 s +PDAF --- duration of forecast phase: 0.009 s PDAF Call pre-post routine after forecast; step 2 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -165,7 +165,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 5.187D+01 3.005D+01 7.7D-02 7.3D-01 - 2 5 2.490D+01 1.257D-08 6.0D-02 7.0D-16 + 2 5 2.490D+01 1.257D-08 6.0D-02 5.7D-16 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -193,7 +193,7 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.004 s +PDAF --- duration of En3D-Var update: 0.003 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean @@ -208,7 +208,7 @@ PDAF --- Distribute sub-ensembles step 4 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.021 s +PDAF --- duration of forecast phase: 0.007 s PDAF Call pre-post routine after forecast; step 4 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -236,7 +236,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 1.706D+01 2.423D+00 3.6D-02 1.3D-01 - 2 5 1.668D+01 4.483D-09 1.3D-01 3.0D-15 + 2 5 1.668D+01 4.483D-09 1.3D-01 -1.9D-15 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -264,13 +264,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.004 s +PDAF --- duration of En3D-Var update: 0.002 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.6119E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.011 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 4 Next observation at time step 6 PDAF Evolve state ensemble @@ -279,13 +279,13 @@ PDAF --- Distribute sub-ensembles step 6 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.006 s +PDAF --- duration of forecast phase: 0.042 s PDAF Call pre-post routine after forecast; step 6 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.6119E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.012 s +PDAF --- duration of prestep: 0.011 s PDAF Analysis ------------------------------------------------------- PDAF 6 Assimilating observations - ensemble 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -307,7 +307,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 1.976D+01 1.762D-01 6.0D-02 3.9D-02 - 2 5 1.976D+01 5.862D-09 2.0D-01 -5.2D-14 + 2 5 1.976D+01 5.862D-09 2.0D-01 -5.0D-14 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -350,7 +350,7 @@ PDAF --- Distribute sub-ensembles step 8 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.027 s PDAF Call pre-post routine after forecast; step 8 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -378,7 +378,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 9.564D+00 4.870D-01 1.7D-01 3.2D-01 - 2 5 9.551D+00 6.416D-09 1.1D-01 -6.6D-15 + 2 5 9.551D+00 6.416D-09 1.1D-01 -2.6D-15 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -406,7 +406,7 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.003 s +PDAF --- duration of En3D-Var update: 0.002 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean @@ -421,13 +421,13 @@ PDAF --- Distribute sub-ensembles step 10 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.010 s +PDAF --- duration of forecast phase: 0.009 s PDAF Call pre-post routine after forecast; step 10 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5609E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.011 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 10 Assimilating observations - ensemble 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -449,7 +449,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 8.920D+00 1.298D+00 1.6D-01 2.8D-01 - 2 5 8.788D+00 5.293D-09 1.6D-01 4.0D-15 + 2 5 8.788D+00 5.293D-09 1.6D-01 7.0D-16 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -477,13 +477,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.004 s +PDAF --- duration of En3D-Var update: 0.002 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5473E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.010 s +PDAF --- duration of poststep: 0.011 s PDAF Forecast ------------------------------------------------------- 10 Next observation at time step 12 PDAF Evolve state ensemble @@ -492,13 +492,13 @@ PDAF --- Distribute sub-ensembles step 12 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.022 s +PDAF --- duration of forecast phase: 0.010 s PDAF Call pre-post routine after forecast; step 12 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5473E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.010 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 12 Assimilating observations - ensemble 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -520,7 +520,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 1.465D+01 9.192D-01 1.3D-01 4.8D-02 - 2 5 1.453D+01 5.109D-09 2.8D-01 9.5D-16 + 2 5 1.453D+01 5.109D-09 2.8D-01 5.5D-16 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -548,13 +548,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.004 s +PDAF --- duration of En3D-Var update: 0.002 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5387E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.010 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 12 Next observation at time step 14 PDAF Evolve state ensemble @@ -563,13 +563,13 @@ PDAF --- Distribute sub-ensembles step 14 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.011 s PDAF Call pre-post routine after forecast; step 14 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5387E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.012 s +PDAF --- duration of prestep: 0.011 s PDAF Analysis ------------------------------------------------------- PDAF 14 Assimilating observations - ensemble 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -591,7 +591,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 1.325D+01 2.136D-02 1.3D-01 1.5D-05 - 2 5 1.325D+01 5.795D-09 3.2D-01 4.3D-13 + 2 5 1.325D+01 5.795D-09 3.2D-01 -1.2D-13 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -619,13 +619,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.004 s +PDAF --- duration of En3D-Var update: 0.002 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5309E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.011 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 14 Next observation at time step 16 PDAF Evolve state ensemble @@ -634,13 +634,13 @@ PDAF --- Distribute sub-ensembles step 16 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.009 s PDAF Call pre-post routine after forecast; step 16 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5309E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.011 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 16 Assimilating observations - ensemble 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -662,7 +662,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 1.780D+01 3.136D-01 1.8D-01 5.0D-02 - 2 5 1.778D+01 5.654D-09 3.2D-01 3.6D-15 + 2 5 1.778D+01 5.654D-09 3.2D-01 -3.1D-15 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -696,7 +696,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 5.5259E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.011 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 16 Next observation at time step 18 PDAF Evolve state ensemble @@ -705,13 +705,13 @@ PDAF --- Distribute sub-ensembles step 18 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.013 s +PDAF --- duration of forecast phase: 0.014 s PDAF Call pre-post routine after forecast; step 18 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5259E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.012 s +PDAF --- duration of prestep: 0.011 s PDAF Analysis ------------------------------------------------------- PDAF 18 Assimilating observations - ensemble 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -733,7 +733,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 2.240D+01 7.699D-01 1.8D-01 6.5D-02 - 2 5 2.231D+01 7.971D-09 3.2D-01 3.7D-15 + 2 5 2.231D+01 7.971D-09 3.2D-01 1.4D-15 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -761,13 +761,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.004 s +PDAF --- duration of En3D-Var update: 0.003 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5208E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.010 s +PDAF --- duration of poststep: 0.011 s PDAF Forecast ------------------------------------------------------- 18 No more observations - end assimilation @@ -783,25 +783,23 @@ PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- PDAF Initialize PDAF: 0.010 s PDAF init_ens_pdaf: 0.004 s -PDAF Ensemble forecast: 0.103 s -PDAF MPI communication in PDAF: 0.101 s +PDAF Ensemble forecast: 0.138 s +PDAF MPI communication in PDAF: 0.138 s PDAF distribute_state_pdaf: 0.000 s PDAF collect_state_pdaf: 0.000 s -PDAF En3DVAR analysis: 0.065 s -PDAF PDAF-internal operations: 0.005 s -PDAF OMI-internal routines: 0.011 s -PDAF Solver: 0.000 s -PDAF cvt_ens_pdaf: 0.001 s -PDAF cvt_ens_adj_pdaf: 0.001 s +PDAF En3DVAR analysis: 0.043 s +PDAF PDAF-internal operations: 0.011 s +PDAF OMI-internal routines: 0.000 s +PDAF Solver: 0.001 s +PDAF cvt_ens_pdaf: 0.000 s +PDAF cvt_ens_adj_pdaf: 0.000 s PDAF Timers in LESTKF only PDAF init_n_domains_pdaf: 0.000 s -PDAF init_dim_l_pdaf: 0.000 s -PDAF g2l_state_pdaf: 0.000 s -PDAF l2g_state_pdaf: 0.001 s +PDAF init_dim_l_pdaf: 0.002 s PDAF Time in OMI observation module routines PDAF init_dim_obs_pdafomi: 0.008 s PDAF obs_op_pdafomi: 0.000 s PDAF obs_op_lin_pdafomi: 0.000 s PDAF obs_op_adj_pdafomi: 0.000 s -PDAF init_dim_obs_l_pdafomi: 0.019 s -PDAF prepoststep_pdaf: 0.195 s +PDAF init_dim_obs_l_pdafomi: 0.004 s +PDAF prepoststep_pdaf: 0.203 s diff --git a/tutorial/verification/out.online_2D_serialmodel_3dlenvar_opt3 b/tutorial/verification/out.online_2D_serialmodel_3dlenvar_opt3 index 771cbf7a3..e89463c35 100644 --- a/tutorial/verification/out.online_2D_serialmodel_3dlenvar_opt3 +++ b/tutorial/verification/out.online_2D_serialmodel_3dlenvar_opt3 @@ -63,7 +63,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -119,7 +119,7 @@ PDAF Call pre-post routine at initial time Analyze initial state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.7637E-01 -PDAF --- duration of prestep: 0.001 s +PDAF --- duration of prestep: 0.000 s PDAF Forecast ------------------------------------------------------- 0 Next observation at time step 2 PDAF Evolve state ensemble @@ -182,7 +182,7 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.004 s +PDAF --- duration of En3D-Var update: 0.002 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean @@ -203,7 +203,7 @@ PDAF Call pre-post routine after forecast; step 4 --- compute ensemble mean RMS error according to sampled variance: 5.6883E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.011 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 4 Assimilating observations - ensemble 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -242,13 +242,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.004 s +PDAF --- duration of En3D-Var update: 0.003 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.6119E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.011 s +PDAF --- duration of poststep: 0.013 s PDAF Forecast ------------------------------------------------------- 4 Next observation at time step 6 PDAF Evolve state ensemble @@ -257,13 +257,13 @@ PDAF --- Distribute sub-ensembles step 6 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.006 s +PDAF --- duration of forecast phase: 0.041 s PDAF Call pre-post routine after forecast; step 6 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.6119E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.013 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 6 Assimilating observations - ensemble 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -302,13 +302,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.004 s +PDAF --- duration of En3D-Var update: 0.003 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5793E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.012 s +PDAF --- duration of poststep: 0.013 s PDAF Forecast ------------------------------------------------------- 6 Next observation at time step 8 PDAF Evolve state ensemble @@ -317,13 +317,13 @@ PDAF --- Distribute sub-ensembles step 8 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.006 s +PDAF --- duration of forecast phase: 0.041 s PDAF Call pre-post routine after forecast; step 8 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5793E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.011 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 8 Assimilating observations - ensemble 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -368,7 +368,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 5.5609E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.013 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 8 Next observation at time step 10 PDAF Evolve state ensemble @@ -377,13 +377,13 @@ PDAF --- Distribute sub-ensembles step 10 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.009 s +PDAF --- duration of forecast phase: 0.017 s PDAF Call pre-post routine after forecast; step 10 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5609E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.011 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 10 Assimilating observations - ensemble 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -422,13 +422,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.004 s +PDAF --- duration of En3D-Var update: 0.002 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5473E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.011 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 10 Next observation at time step 12 PDAF Evolve state ensemble @@ -437,13 +437,13 @@ PDAF --- Distribute sub-ensembles step 12 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.020 s +PDAF --- duration of forecast phase: 0.010 s PDAF Call pre-post routine after forecast; step 12 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5473E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.012 s +PDAF --- duration of prestep: 0.011 s PDAF Analysis ------------------------------------------------------- PDAF 12 Assimilating observations - ensemble 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -482,13 +482,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.004 s +PDAF --- duration of En3D-Var update: 0.003 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5387E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.011 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 12 Next observation at time step 14 PDAF Evolve state ensemble @@ -497,13 +497,13 @@ PDAF --- Distribute sub-ensembles step 14 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.023 s +PDAF --- duration of forecast phase: 0.010 s PDAF Call pre-post routine after forecast; step 14 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5387E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.011 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 14 Assimilating observations - ensemble 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -542,13 +542,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.003 s +PDAF --- duration of En3D-Var update: 0.002 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5309E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.012 s +PDAF --- duration of poststep: 0.013 s PDAF Forecast ------------------------------------------------------- 14 Next observation at time step 16 PDAF Evolve state ensemble @@ -557,7 +557,7 @@ PDAF --- Distribute sub-ensembles step 16 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.023 s +PDAF --- duration of forecast phase: 0.009 s PDAF Call pre-post routine after forecast; step 16 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -602,13 +602,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.004 s +PDAF --- duration of En3D-Var update: 0.003 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5259E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.011 s +PDAF --- duration of poststep: 0.013 s PDAF Forecast ------------------------------------------------------- 16 Next observation at time step 18 PDAF Evolve state ensemble @@ -617,13 +617,13 @@ PDAF --- Distribute sub-ensembles step 18 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.023 s +PDAF --- duration of forecast phase: 0.014 s PDAF Call pre-post routine after forecast; step 18 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5259E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.012 s +PDAF --- duration of prestep: 0.013 s PDAF Analysis ------------------------------------------------------- PDAF 18 Assimilating observations - ensemble 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -662,13 +662,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of En3D-Var update: 0.004 s +PDAF --- duration of En3D-Var update: 0.002 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5208E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.011 s +PDAF --- duration of poststep: 0.013 s PDAF Forecast ------------------------------------------------------- 18 No more observations - end assimilation @@ -683,26 +683,24 @@ PDAF analysis step: 0.031 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- PDAF Initialize PDAF: 0.009 s -PDAF init_ens_pdaf: 0.003 s -PDAF Ensemble forecast: 0.126 s -PDAF MPI communication in PDAF: 0.125 s +PDAF init_ens_pdaf: 0.004 s +PDAF Ensemble forecast: 0.158 s +PDAF MPI communication in PDAF: 0.158 s PDAF distribute_state_pdaf: 0.000 s PDAF collect_state_pdaf: 0.000 s -PDAF En3DVAR analysis: 0.068 s -PDAF PDAF-internal operations: 0.004 s -PDAF OMI-internal routines: 0.008 s +PDAF En3DVAR analysis: 0.046 s +PDAF PDAF-internal operations: 0.008 s +PDAF OMI-internal routines: 0.001 s PDAF Solver: 0.000 s -PDAF cvt_ens_pdaf: 0.000 s -PDAF cvt_ens_adj_pdaf: 0.000 s +PDAF cvt_ens_pdaf: 0.001 s +PDAF cvt_ens_adj_pdaf: 0.001 s PDAF Timers in LESTKF only PDAF init_n_domains_pdaf: 0.000 s PDAF init_dim_l_pdaf: 0.000 s -PDAF g2l_state_pdaf: 0.001 s -PDAF l2g_state_pdaf: 0.000 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.011 s +PDAF init_dim_obs_pdafomi: 0.009 s PDAF obs_op_pdafomi: 0.000 s PDAF obs_op_lin_pdafomi: 0.000 s PDAF obs_op_adj_pdafomi: 0.000 s -PDAF init_dim_obs_l_pdafomi: 0.017 s -PDAF prepoststep_pdaf: 0.207 s +PDAF init_dim_obs_l_pdafomi: 0.004 s +PDAF prepoststep_pdaf: 0.218 s diff --git a/tutorial/verification/out.online_2D_serialmodel_3dlhybvar_opt2 b/tutorial/verification/out.online_2D_serialmodel_3dlhybvar_opt2 index e1655f81e..4faaa65b1 100644 --- a/tutorial/verification/out.online_2D_serialmodel_3dlhybvar_opt2 +++ b/tutorial/verification/out.online_2D_serialmodel_3dlhybvar_opt2 @@ -47,11 +47,11 @@ INITIALIZE 2D TUTORIAL MODEL Grid size: 36 x 18 Time steps 18 - - INITIALIZE PDAF - ONLINE MODE INITIALIZE 2D TUTORIAL MODEL Grid size: 36 x 18 Time steps 18 + + INITIALIZE PDAF - ONLINE MODE PARSER: dim_ens= 9 PARSER: filtertype= 200 PARSER: subtype= 6 @@ -64,7 +64,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -146,7 +146,7 @@ PDAF Call pre-post routine after forecast; step 2 --- compute ensemble mean RMS error according to sampled variance: 5.7637E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.011 s +PDAF --- duration of prestep: 0.010 s PDAF Analysis ------------------------------------------------------- PDAF 2 Assimilating observations - hybrid 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -197,13 +197,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of hyb3D-Var update: 0.004 s +PDAF --- duration of hyb3D-Var update: 0.002 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.6883E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.011 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 2 Next observation at time step 4 PDAF Evolve state ensemble @@ -269,13 +269,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of hyb3D-Var update: 0.004 s +PDAF --- duration of hyb3D-Var update: 0.003 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.6119E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.011 s +PDAF --- duration of poststep: 0.013 s PDAF Forecast ------------------------------------------------------- 4 Next observation at time step 6 PDAF Evolve state ensemble @@ -284,7 +284,7 @@ PDAF --- Distribute sub-ensembles step 6 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.031 s PDAF Call pre-post routine after forecast; step 6 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -341,13 +341,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of hyb3D-Var update: 0.004 s +PDAF --- duration of hyb3D-Var update: 0.002 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5793E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.011 s +PDAF --- duration of poststep: 0.014 s PDAF Forecast ------------------------------------------------------- 6 Next observation at time step 8 PDAF Evolve state ensemble @@ -356,13 +356,13 @@ PDAF --- Distribute sub-ensembles step 8 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.006 s +PDAF --- duration of forecast phase: 0.031 s PDAF Call pre-post routine after forecast; step 8 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5793E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.012 s +PDAF --- duration of prestep: 0.013 s PDAF Analysis ------------------------------------------------------- PDAF 8 Assimilating observations - hybrid 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -413,13 +413,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of hyb3D-Var update: 0.004 s +PDAF --- duration of hyb3D-Var update: 0.003 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5609E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.013 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 8 Next observation at time step 10 PDAF Evolve state ensemble @@ -428,13 +428,13 @@ PDAF --- Distribute sub-ensembles step 10 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.007 s +PDAF --- duration of forecast phase: 0.014 s PDAF Call pre-post routine after forecast; step 10 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5609E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.011 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 10 Assimilating observations - hybrid 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -457,7 +457,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 8.750D+00 1.548D+00 6.3D-02 2.2D-01 - 4 9 8.548D+00 1.292D-11 9.8D-01 7.6D-12 + 4 9 8.548D+00 1.283D-11 9.8D-01 7.9D-12 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -485,13 +485,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of hyb3D-Var update: 0.003 s +PDAF --- duration of hyb3D-Var update: 0.002 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5473E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.012 s +PDAF --- duration of poststep: 0.013 s PDAF Forecast ------------------------------------------------------- 10 Next observation at time step 12 PDAF Evolve state ensemble @@ -500,7 +500,7 @@ PDAF --- Distribute sub-ensembles step 12 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.022 s +PDAF --- duration of forecast phase: 0.008 s PDAF Call pre-post routine after forecast; step 12 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -529,7 +529,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 1.425D+01 7.126D-01 5.5D-02 8.9D-03 - 4 9 1.421D+01 6.364D-12 9.8D-01 -7.6D-13 + 4 9 1.421D+01 6.418D-12 9.8D-01 3.3D-13 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -557,7 +557,7 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of hyb3D-Var update: 0.003 s +PDAF --- duration of hyb3D-Var update: 0.002 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean @@ -572,7 +572,7 @@ PDAF --- Distribute sub-ensembles step 14 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.021 s +PDAF --- duration of forecast phase: 0.013 s PDAF Call pre-post routine after forecast; step 14 Analyze and write forecasted state ensemble --- compute ensemble mean @@ -601,7 +601,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 1.327D+01 1.483D+00 1.3D-01 7.4D-02 - 4 9 1.317D+01 7.967D-12 9.7D-01 5.5D-13 + 4 9 1.317D+01 7.966D-12 9.7D-01 7.5D-13 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -629,7 +629,7 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of hyb3D-Var update: 0.003 s +PDAF --- duration of hyb3D-Var update: 0.002 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean @@ -644,13 +644,13 @@ PDAF --- Distribute sub-ensembles step 16 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.020 s +PDAF --- duration of forecast phase: 0.010 s PDAF Call pre-post routine after forecast; step 16 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5309E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.011 s +PDAF --- duration of prestep: 0.012 s PDAF Analysis ------------------------------------------------------- PDAF 16 Assimilating observations - hybrid 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -673,7 +673,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 1.804D+01 7.156D-01 5.8D-02 6.2D-02 - 4 9 1.792D+01 8.888D-12 9.7D-01 1.6D-13 + 4 9 1.792D+01 8.857D-12 9.7D-01 -1.0D-13 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -707,7 +707,7 @@ PDAF Call pre-post routine after analysis step --- compute ensemble mean RMS error according to sampled variance: 5.5259E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.011 s +PDAF --- duration of poststep: 0.012 s PDAF Forecast ------------------------------------------------------- 16 Next observation at time step 18 PDAF Evolve state ensemble @@ -716,13 +716,13 @@ PDAF --- Distribute sub-ensembles step 18 PDAF Perform assimilation with PDAF PDAF --- Gather sub-ensembles on filter task -PDAF --- duration of forecast phase: 0.023 s +PDAF --- duration of forecast phase: 0.019 s PDAF Call pre-post routine after forecast; step 18 Analyze and write forecasted state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5259E-01 --- write ensemble and state estimate -PDAF --- duration of prestep: 0.012 s +PDAF --- duration of prestep: 0.013 s PDAF Analysis ------------------------------------------------------- PDAF 18 Assimilating observations - hybrid 3DVAR with LESTKF PDAF Step 1: Update state estimate with variational solver @@ -745,7 +745,7 @@ INITIAL VALUES: I NFN FUNC GNORM STEPLEN BETA ---------------------------------------------------- 1 3 2.234D+01 1.766D+00 6.2D-02 1.4D-01 - 4 9 2.205D+01 1.486D-11 9.8D-01 3.6D-13 + 4 9 2.205D+01 1.422D-11 9.8D-01 2.8D-13 SUCCESSFUL CONVERGENCE (NO ERRORS). IFLAG = 0 @@ -773,13 +773,13 @@ PDAF Local domains without observations: 620 PDAF Maximum local observation dimension: 1 PDAF Total avg. local observation dimension: 0.0 PDAF Avg. for domains with observations: 1.0 -PDAF --- duration of hyb3D-Var update: 0.003 s +PDAF --- duration of hyb3D-Var update: 0.002 s PDAF Call pre-post routine after analysis step Analyze and write assimilated state ensemble --- compute ensemble mean RMS error according to sampled variance: 5.5208E-01 --- write ensemble and state estimate -PDAF --- duration of poststep: 0.011 s +PDAF --- duration of poststep: 0.013 s PDAF Forecast ------------------------------------------------------- 18 No more observations - end assimilation @@ -795,25 +795,23 @@ PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- PDAF Initialize PDAF: 0.009 s PDAF init_ens_pdaf: 0.004 s -PDAF Ensemble forecast: 0.123 s -PDAF MPI communication in PDAF: 0.123 s +PDAF Ensemble forecast: 0.143 s +PDAF MPI communication in PDAF: 0.143 s PDAF distribute_state_pdaf: 0.000 s PDAF collect_state_pdaf: 0.000 s -PDAF Hyb3DVAR analysis: 0.062 s -PDAF PDAF-internal operations: 0.008 s -PDAF OMI-internal routines: 0.012 s -PDAF Solver: 0.000 s -PDAF cvt_ens_pdaf: 0.001 s +PDAF Hyb3DVAR analysis: 0.041 s +PDAF PDAF-internal operations: 0.009 s +PDAF OMI-internal routines: 0.000 s +PDAF Solver: 0.001 s +PDAF cvt_ens_pdaf: 0.002 s PDAF cvt_ens_adj_pdaf: 0.000 s PDAF Timers in LESTKF only PDAF init_n_domains_pdaf: 0.000 s -PDAF init_dim_l_pdaf: 0.001 s -PDAF g2l_state_pdaf: 0.000 s -PDAF l2g_state_pdaf: 0.001 s +PDAF init_dim_l_pdaf: 0.000 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.008 s +PDAF init_dim_obs_pdafomi: 0.005 s PDAF obs_op_pdafomi: 0.000 s -PDAF obs_op_lin_pdafomi: 0.001 s +PDAF obs_op_lin_pdafomi: 0.000 s PDAF obs_op_adj_pdafomi: 0.000 s -PDAF init_dim_obs_l_pdafomi: 0.014 s -PDAF prepoststep_pdaf: 0.210 s +PDAF init_dim_obs_l_pdafomi: 0.006 s +PDAF prepoststep_pdaf: 0.222 s diff --git a/tutorial/verification/out.online_2D_serialmodel_ESTKF b/tutorial/verification/out.online_2D_serialmodel_ESTKF index 4b5414914..e23e9ffc4 100644 --- a/tutorial/verification/out.online_2D_serialmodel_ESTKF +++ b/tutorial/verification/out.online_2D_serialmodel_ESTKF @@ -65,7 +65,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -403,16 +403,16 @@ PDAF analysis step: 0.027 MiB (temporary) PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- -PDAF Initialize PDAF: 0.026 s +PDAF Initialize PDAF: 0.010 s PDAF init_ens_pdaf: 0.004 s -PDAF Ensemble forecast: 0.111 s -PDAF MPI communication in PDAF: 0.110 s +PDAF Ensemble forecast: 0.146 s +PDAF MPI communication in PDAF: 0.145 s PDAF distribute_state_pdaf: 0.000 s PDAF collect_state_pdaf: 0.000 s -PDAF ESTKF analysis: 0.005 s -PDAF PDAF-internal operations: 0.001 s -PDAF OMI-internal routines: 0.008 s +PDAF ESTKF analysis: 0.007 s +PDAF PDAF-internal operations: 0.002 s +PDAF OMI-internal routines: 0.000 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.004 s +PDAF init_dim_obs_pdafomi: 0.005 s PDAF obs_op_pdafomi: 0.000 s -PDAF prepoststep_pdaf: 0.218 s +PDAF prepoststep_pdaf: 0.219 s diff --git a/tutorial/verification/out.online_2D_serialmodel_openmp b/tutorial/verification/out.online_2D_serialmodel_openmp index e3f06e507..c6436dc36 100644 --- a/tutorial/verification/out.online_2D_serialmodel_openmp +++ b/tutorial/verification/out.online_2D_serialmodel_openmp @@ -47,11 +47,11 @@ INITIALIZE 2D TUTORIAL MODEL Grid size: 36 x 18 Time steps 18 - - INITIALIZE PDAF - ONLINE MODE INITIALIZE 2D TUTORIAL MODEL Grid size: 36 x 18 Time steps 18 + + INITIALIZE PDAF - ONLINE MODE PARSER: screen= 1 PARSER: dim_ens= 9 PARSER: filtertype= 7 @@ -65,7 +65,7 @@ PDAF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PDAF +++ PDAF +++ PDAF +++ Parallel Data Assimilation Framework +++ PDAF +++ +++ -PDAF +++ Version 2.2.1 +++ +PDAF +++ Version 2.3 +++ PDAF +++ +++ PDAF +++ Please cite +++ PDAF +++ L. Nerger and W. Hiller, Computers and Geosciences +++ @@ -533,19 +533,17 @@ PDAF PDAF Timing information - call-back routines PDAF ---------------------------------------------------- PDAF Initialize PDAF: 0.010 s PDAF init_ens_pdaf: 0.004 s -PDAF Ensemble forecast: 0.111 s -PDAF MPI communication in PDAF: 0.111 s +PDAF Ensemble forecast: 0.160 s +PDAF MPI communication in PDAF: 0.159 s PDAF distribute_state_pdaf: 0.000 s PDAF collect_state_pdaf: 0.000 s -PDAF LESTKF analysis: 0.031 s -PDAF PDAF-internal operations: 0.003 s -PDAF OMI-internal routines: 0.013 s +PDAF LESTKF analysis: 0.022 s +PDAF PDAF-internal operations: 0.008 s +PDAF OMI-internal routines: 0.000 s PDAF init_n_domains_pdaf: 0.000 s -PDAF init_dim_l_pdaf: 0.002 s -PDAF g2l_state_pdaf: 0.000 s -PDAF l2g_state_pdaf: 0.000 s +PDAF init_dim_l_pdaf: 0.000 s PDAF Time in OMI observation module routines -PDAF init_dim_obs_pdafomi: 0.004 s +PDAF init_dim_obs_pdafomi: 0.002 s PDAF obs_op_pdafomi: 0.000 s -PDAF init_dim_obs_l_pdafomi: 0.018 s -PDAF prepoststep_pdaf: 0.188 s +PDAF init_dim_obs_l_pdafomi: 0.004 s +PDAF prepoststep_pdaf: 0.266 s