diff --git a/etc/fcm-make/compiler/cray_12_plus.cfg b/etc/fcm-make/compiler/cray_12_plus.cfg index bc8fe63b..4fb0c2a0 100644 --- a/etc/fcm-make/compiler/cray_12_plus.cfg +++ b/etc/fcm-make/compiler/cray_12_plus.cfg @@ -60,4 +60,4 @@ $SOURCE_PATH_PREFIX{?} = jules build.prop{fc.flags}[$SOURCE_PATH_PREFIX/src/io/model_interface/model_interface_mod.F90] = -O0 -Ovector0 -hfp0 -hflex_mp=strict -hipa0 # # File override to circumvent compiler bug - compiler version: cce/12.0.1 -build.prop{fc.flags}[$SOURCE_PATH_PREFIX/src/initialisation/standalone/init_prescribed_data.F90] = $fflags_common -O1 +build.prop{fc.flags}[$SOURCE_PATH_PREFIX/src/initialisation/standalone/init_prescribed_data_mod.F90] = $fflags_common -O1 diff --git a/etc/fcm-make/make-river.cfg b/etc/fcm-make/make-river.cfg index 68c43e11..81789894 100644 --- a/etc/fcm-make/make-river.cfg +++ b/etc/fcm-make/make-river.cfg @@ -89,7 +89,7 @@ extract.path-incl[river] = $extract_path_incl \ src/initialisation/standalone/init_output_mod.F90 \ src/initialisation/standalone/init_rivers.F90 \ src/initialisation/standalone/init_initial_mod.F90 \ - src/initialisation/standalone/init_prescribed_data.F90 \ + src/initialisation/standalone/init_prescribed_data_mod.F90 \ src/io/dump \ src/io/file_handling \ src/io/input/fill_variables_from_file_mod.F90 \ diff --git a/etc/fcm-make/make.cfg b/etc/fcm-make/make.cfg index cf27c477..35d88747 100644 --- a/etc/fcm-make/make.cfg +++ b/etc/fcm-make/make.cfg @@ -65,11 +65,7 @@ preprocess.prop{file-ext.h} = .inc build.target = rose-run jules.exe # Explicit dependencies that need to be defined -build.prop{ns-dep.o}[jules/src/control/standalone/jules.F90] = jules/src/initialisation/standalone \ - jules/src/science \ - jules/src/control/imogen \ - jules/utils -build.prop{dep.o}[jules/src/control/standalone/jules.F90] = control.o +build.prop{ns-dep.o}[jules/src/control/standalone/jules.F90] = jules/utils ################################################################################ diff --git a/src/control/imogen/clim_calc.F90 b/src/control/imogen/clim_calc_mod.F90 similarity index 98% rename from src/control/imogen/clim_calc.F90 rename to src/control/imogen/clim_calc_mod.F90 index 15ccd25d..a9959a0b 100644 --- a/src/control/imogen/clim_calc.F90 +++ b/src/control/imogen/clim_calc_mod.F90 @@ -9,6 +9,12 @@ ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** +MODULE clim_calc_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE clim_calc(land_pts, mm, md, nsdmax, seed_rain, imgn_drive, ainfo) USE missing_data_mod, ONLY: rmdi @@ -18,6 +24,7 @@ SUBROUTINE clim_calc(land_pts, mm, md, nsdmax, seed_rain, imgn_drive, ainfo) USE ancil_info, ONLY: ainfo_type USE theta_field_sizes, ONLY: t_i_length USE imogen_run, ONLY: l_daily_metdata_climatol +USE day_calc_mod, ONLY: day_calc IMPLICIT NONE @@ -47,7 +54,7 @@ SUBROUTINE clim_calc(land_pts, mm, md, nsdmax, seed_rain, imgn_drive, ainfo) ! Seeding number for subdaily rainfall. TYPE(imgn_drive_type), INTENT(IN OUT) :: imgn_drive -TYPE(ainfo_type), INTENT(IN OUT) :: ainfo +TYPE(ainfo_type), INTENT(IN) :: ainfo ! Create "subdaily" values of the arrays below using day_calc REAL :: & @@ -220,4 +227,5 @@ SUBROUTINE clim_calc(land_pts, mm, md, nsdmax, seed_rain, imgn_drive, ainfo) RETURN END SUBROUTINE clim_calc +END MODULE clim_calc_mod #endif diff --git a/src/control/imogen/day_calc.F90 b/src/control/imogen/day_calc_mod.F90 similarity index 99% rename from src/control/imogen/day_calc.F90 rename to src/control/imogen/day_calc_mod.F90 index 6f73081c..14457c6f 100644 --- a/src/control/imogen/day_calc.F90 +++ b/src/control/imogen/day_calc_mod.F90 @@ -8,6 +8,13 @@ ! ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** + +MODULE day_calc_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE day_calc( & land_pts, swdown_daily, precip_daily, tl1_daily, diurnal_tl1_daily, & lwdown_daily, pstar_daily, wind_daily, ql1_daily, swdown_subdaily, & @@ -24,6 +31,7 @@ SUBROUTINE day_calc( & USE model_grid_mod, ONLY: latitude, longitude USE theta_field_sizes, ONLY: t_i_length, t_j_length USE jules_fields_mod, ONLY: ainfo +USE rndm_mod, ONLY: rndm ! USE update_mod, ONLY: t_for_snow, t_for_con_rain ! ejb add trap in imogen nml to ensure they are read ! not activated in #1322 because metadata is a nightmare @@ -468,4 +476,5 @@ SUBROUTINE day_calc( & RETURN END SUBROUTINE day_calc +END MODULE day_calc_mod #endif diff --git a/src/control/imogen/delta_temp.F90 b/src/control/imogen/delta_temp_mod.F90 similarity index 98% rename from src/control/imogen/delta_temp.F90 rename to src/control/imogen/delta_temp_mod.F90 index 8a4e38e1..76c1c818 100644 --- a/src/control/imogen/delta_temp.F90 +++ b/src/control/imogen/delta_temp_mod.F90 @@ -8,9 +8,18 @@ ! ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** + +MODULE delta_temp_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE delta_temp( & n_olevs,f_ocean,kappa_o,lambda_l,lambda_o,mu,dqradf,dtemp_l,dtemp_o, dtemp_g) +USE invert_mod, ONLY: invert + USE veg_param, ONLY: secs_per_360days USE jules_print_mgr, ONLY: jules_message, jules_print @@ -204,4 +213,5 @@ SUBROUTINE delta_temp( & RETURN END SUBROUTINE delta_temp +END MODULE delta_temp_mod #endif diff --git a/src/control/imogen/diff_atmos_ch4.F90 b/src/control/imogen/diff_atmos_ch4_mod.F90 similarity index 97% rename from src/control/imogen/diff_atmos_ch4.F90 rename to src/control/imogen/diff_atmos_ch4_mod.F90 index 482ad9b0..81af95cd 100644 --- a/src/control/imogen/diff_atmos_ch4.F90 +++ b/src/control/imogen/diff_atmos_ch4_mod.F90 @@ -8,6 +8,13 @@ ! ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** + +MODULE diff_atmos_ch4_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE diff_atmos_ch4(d_land_atmos_ch4, ch4_ppbv) USE io_constants, ONLY: imogen_unit @@ -130,6 +137,6 @@ SUBROUTINE diff_atmos_ch4(d_land_atmos_ch4, ch4_ppbv) RETURN -END - +END SUBROUTINE diff_atmos_ch4 +END MODULE diff_atmos_ch4_mod #endif diff --git a/src/control/imogen/diffcarb_land_ch4.F90 b/src/control/imogen/diffcarb_land_ch4_mod.F90 similarity index 97% rename from src/control/imogen/diffcarb_land_ch4.F90 rename to src/control/imogen/diffcarb_land_ch4_mod.F90 index 870b604a..1e0482e9 100644 --- a/src/control/imogen/diffcarb_land_ch4.F90 +++ b/src/control/imogen/diffcarb_land_ch4_mod.F90 @@ -2,6 +2,13 @@ ! ********************************************************************* ! Calculates the global change in atmospheric CH4 ! ********************************************************************* + +MODULE diffcarb_land_ch4_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE diffcarb_land_ch4(land_pts, d_land_atmos_ch4, darea, dctot_ch4) USE imogen_run, ONLY: fch4_ref, yr_fch4_ref @@ -78,4 +85,5 @@ SUBROUTINE diffcarb_land_ch4(land_pts, d_land_atmos_ch4, darea, dctot_ch4) RETURN END SUBROUTINE diffcarb_land_ch4 +END MODULE diffcarb_land_ch4_mod #endif diff --git a/src/control/imogen/diffcarb_land_co2.F90 b/src/control/imogen/diffcarb_land_co2_mod.F90 similarity index 96% rename from src/control/imogen/diffcarb_land_co2.F90 rename to src/control/imogen/diffcarb_land_co2_mod.F90 index b7ddc70d..0de89113 100644 --- a/src/control/imogen/diffcarb_land_co2.F90 +++ b/src/control/imogen/diffcarb_land_co2_mod.F90 @@ -9,6 +9,12 @@ ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** +MODULE diffcarb_land_co2_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE diffcarb_land_co2(land_pts, d_land_atmos_co2, darea, dctot_co2) USE conversions_mod, ONLY: conv_gtc_to_ppm @@ -66,4 +72,5 @@ SUBROUTINE diffcarb_land_co2(land_pts, d_land_atmos_co2, darea, dctot_co2) RETURN END SUBROUTINE diffcarb_land_co2 +END MODULE diffcarb_land_co2_mod #endif diff --git a/src/control/imogen/drdat.F90 b/src/control/imogen/drdat_mod.F90 similarity index 98% rename from src/control/imogen/drdat.F90 rename to src/control/imogen/drdat_mod.F90 index 1ddd8852..f09dd436 100644 --- a/src/control/imogen/drdat.F90 +++ b/src/control/imogen/drdat_mod.F90 @@ -9,6 +9,12 @@ ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** +MODULE drdat_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE drdat(iyear) USE fill_variables_from_file_mod, ONLY: fill_variables_from_file @@ -82,4 +88,5 @@ SUBROUTINE drdat(iyear) RETURN END SUBROUTINE drdat +END MODULE drdat_mod #endif diff --git a/src/control/imogen/imogen_check.F90 b/src/control/imogen/imogen_check_mod.F90 similarity index 99% rename from src/control/imogen/imogen_check.F90 rename to src/control/imogen/imogen_check_mod.F90 index 5e73444d..fd3632b6 100644 --- a/src/control/imogen/imogen_check.F90 +++ b/src/control/imogen/imogen_check_mod.F90 @@ -8,6 +8,13 @@ ! ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** + +MODULE imogen_check_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE imogen_check( & c_emissions, include_co2, include_non_co2_radf, land_feed_co2, & land_feed_ch4, ocean_feed, change_metdata_method, l_change_metdata) @@ -284,4 +291,5 @@ SUBROUTINE imogen_check( & RETURN END SUBROUTINE imogen_check +END MODULE imogen_check_mod #endif diff --git a/src/control/imogen/imogen_update_carb.F90 b/src/control/imogen/imogen_update_carb_mod.F90 similarity index 97% rename from src/control/imogen/imogen_update_carb.F90 rename to src/control/imogen/imogen_update_carb_mod.F90 index 5c9a7a73..2381de98 100644 --- a/src/control/imogen/imogen_update_carb.F90 +++ b/src/control/imogen/imogen_update_carb_mod.F90 @@ -9,6 +9,12 @@ ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** +MODULE imogen_update_carb_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE imogen_update_carb(progs, imgn_vars) USE model_grid_mod, ONLY: grid_area_ij @@ -42,6 +48,14 @@ SUBROUTINE imogen_update_carb(progs, imgn_vars) USE imogen_io_vars, ONLY: & yr_emiss,c_emiss +USE diffcarb_land_co2_mod, ONLY: diffcarb_land_co2 + +USE ocean_co2_mod, ONLY: ocean_co2 + +USE diffcarb_land_ch4_mod, ONLY: diffcarb_land_ch4 + +USE diff_atmos_ch4_mod, ONLY: diff_atmos_ch4 + USE logging_mod, ONLY: log_fatal !TYPE definitions @@ -246,4 +260,5 @@ SUBROUTINE imogen_update_carb(progs, imgn_vars) RETURN END SUBROUTINE imogen_update_carb +END MODULE imogen_update_carb_mod #endif diff --git a/src/control/imogen/imogen_update_clim.F90 b/src/control/imogen/imogen_update_clim_mod.F90 similarity index 96% rename from src/control/imogen/imogen_update_clim.F90 rename to src/control/imogen/imogen_update_clim_mod.F90 index 67ab8a0f..75a43973 100644 --- a/src/control/imogen/imogen_update_clim.F90 +++ b/src/control/imogen/imogen_update_clim_mod.F90 @@ -9,6 +9,12 @@ ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** +MODULE imogen_update_clim_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE imogen_update_clim(progs, imgn_drive, imgn_vars, ainfo) USE model_time_mod, ONLY: current_time @@ -34,6 +40,20 @@ SUBROUTINE imogen_update_clim(progs, imgn_drive, imgn_vars, ainfo) USE imogen_constants, ONLY: n_olevs +USE radf_co2_mod, ONLY: radf_co2 + +USE radf_non_co2_mod, ONLY: radf_non_co2 + +USE radf_ch4_mod, ONLY: radf_ch4 + +USE delta_temp_mod, ONLY: delta_temp + +USE pattern_scaling_mod, ONLY: pattern_scaling + +USE drdat_mod, ONLY: drdat + +USE clim_calc_mod, ONLY: clim_calc + USE logging_mod, ONLY: log_fatal USE jules_print_mgr, ONLY: & @@ -269,4 +289,5 @@ SUBROUTINE imogen_update_clim(progs, imgn_drive, imgn_vars, ainfo) RETURN END SUBROUTINE imogen_update_clim +END MODULE imogen_update_clim_mod #endif diff --git a/src/control/imogen/invert.F90 b/src/control/imogen/invert_mod.F90 similarity index 98% rename from src/control/imogen/invert.F90 rename to src/control/imogen/invert_mod.F90 index aee39e19..d40198a9 100644 --- a/src/control/imogen/invert.F90 +++ b/src/control/imogen/invert_mod.F90 @@ -8,6 +8,13 @@ ! ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** + +MODULE invert_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE invert( & u_old,u_new,p,lambda_old,lambda_new,r1,r2,dz_top,n_olevs & ) @@ -184,4 +191,5 @@ SUBROUTINE invert( & RETURN END SUBROUTINE invert +END MODULE invert_mod #endif diff --git a/src/control/imogen/ocean_co2.F90 b/src/control/imogen/ocean_co2_mod.F90 similarity index 98% rename from src/control/imogen/ocean_co2.F90 rename to src/control/imogen/ocean_co2_mod.F90 index 2f7ba51d..f4e7326b 100644 --- a/src/control/imogen/ocean_co2.F90 +++ b/src/control/imogen/ocean_co2_mod.F90 @@ -9,12 +9,20 @@ ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** +MODULE ocean_co2_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE ocean_co2( & iyear,year_co2,co2_atmos_ppmv,co2_atmos_init_ppmv,dt_ocean, & fa_ocean,ocean_area,grad_co2_atmos_ppmv,year_run, & t_ocean_init,nfarray,d_ocean_atmos & ) +USE response_mod, ONLY: response + USE jules_print_mgr, ONLY: & jules_message, & jules_print @@ -202,4 +210,5 @@ SUBROUTINE ocean_co2( & RETURN END SUBROUTINE ocean_co2 +END MODULE ocean_co2_mod #endif diff --git a/src/control/imogen/gcm_anlg.F90 b/src/control/imogen/pattern_scaling_mod.F90 similarity index 97% rename from src/control/imogen/gcm_anlg.F90 rename to src/control/imogen/pattern_scaling_mod.F90 index c31e8bb4..5e9fc227 100644 --- a/src/control/imogen/gcm_anlg.F90 +++ b/src/control/imogen/pattern_scaling_mod.F90 @@ -9,6 +9,12 @@ ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** +MODULE pattern_scaling_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE pattern_scaling(land_pts, mm, dtemp_g, imgn_drive, ainfo) USE imgn_drive_mod, ONLY: imgn_drive_type @@ -77,4 +83,5 @@ SUBROUTINE pattern_scaling(land_pts, mm, dtemp_g, imgn_drive, ainfo) RETURN END SUBROUTINE pattern_scaling +END MODULE pattern_scaling_mod #endif diff --git a/src/control/imogen/radf_ch4.F90 b/src/control/imogen/radf_ch4_mod.F90 similarity index 98% rename from src/control/imogen/radf_ch4.F90 rename to src/control/imogen/radf_ch4_mod.F90 index 4ad2600b..19eedab6 100644 --- a/src/control/imogen/radf_ch4.F90 +++ b/src/control/imogen/radf_ch4_mod.F90 @@ -8,6 +8,13 @@ ! ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** + +MODULE radf_ch4_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE radf_ch4(ch4_ppbv, q_ch4) USE io_constants, ONLY: imogen_unit @@ -124,8 +131,6 @@ SUBROUTINE calc_q_ch4(ch4_ppbv, ch4_interp_ppbv, n2o_interp_ppbv, q_ch4) ! Local parameters REAL :: & - overlap, & - ! overlap function. olap, & ! overlap fn output with modelled ch4 conc olap_interp ! overlap fn output with reference ch4 conc. @@ -169,4 +174,5 @@ FUNCTION overlap(ch4_ppbv, n2o_ppbv) RESULT(overlap_val) + (5.31e-15 * ch4_ppbv * (ch4_ppbv * n2o_ppbv)** 1.52)) END FUNCTION overlap +END MODULE radf_ch4_mod #endif diff --git a/src/control/imogen/radf_co2.F90 b/src/control/imogen/radf_co2_mod.F90 similarity index 95% rename from src/control/imogen/radf_co2.F90 rename to src/control/imogen/radf_co2_mod.F90 index 93914e9f..a2449b55 100644 --- a/src/control/imogen/radf_co2.F90 +++ b/src/control/imogen/radf_co2_mod.F90 @@ -9,6 +9,12 @@ ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** +MODULE radf_co2_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE radf_co2(co2, co2ref, q2co2, q_co2) IMPLICIT NONE @@ -41,4 +47,5 @@ SUBROUTINE radf_co2(co2, co2ref, q2co2, q_co2) RETURN END SUBROUTINE radf_co2 +END MODULE radf_co2_mod #endif diff --git a/src/control/imogen/radf_non_co2.F90 b/src/control/imogen/radf_non_co2_mod.F90 similarity index 98% rename from src/control/imogen/radf_non_co2.F90 rename to src/control/imogen/radf_non_co2_mod.F90 index 7da2c5fd..b7f8ae02 100644 --- a/src/control/imogen/radf_non_co2.F90 +++ b/src/control/imogen/radf_non_co2_mod.F90 @@ -9,6 +9,12 @@ ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** +MODULE radf_non_co2_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE radf_non_co2( & year,q,nyr_non_co2,file_non_co2_radf) @@ -110,4 +116,5 @@ SUBROUTINE radf_non_co2( & RETURN END SUBROUTINE radf_non_co2 +END MODULE radf_non_co2_mod #endif diff --git a/src/control/imogen/response.F90 b/src/control/imogen/response_mod.F90 similarity index 97% rename from src/control/imogen/response.F90 rename to src/control/imogen/response_mod.F90 index ffe2bcbe..c7fd9b61 100644 --- a/src/control/imogen/response.F90 +++ b/src/control/imogen/response_mod.F90 @@ -9,6 +9,12 @@ ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** +MODULE response_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE response(ncallyr,year_run,rs) IMPLICIT NONE @@ -60,4 +66,5 @@ SUBROUTINE response(ncallyr,year_run,rs) RETURN END SUBROUTINE response +END MODULE response_mod #endif diff --git a/src/control/imogen/rndm.F90 b/src/control/imogen/rndm_mod.F90 similarity index 96% rename from src/control/imogen/rndm.F90 rename to src/control/imogen/rndm_mod.F90 index ce0d4120..a465a117 100644 --- a/src/control/imogen/rndm.F90 +++ b/src/control/imogen/rndm_mod.F90 @@ -9,6 +9,12 @@ ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** +MODULE rndm_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE rndm(random_num,seed) IMPLICIT NONE @@ -64,4 +70,5 @@ SUBROUTINE rndm(random_num,seed) RETURN END SUBROUTINE rndm +END MODULE rndm_mod #endif diff --git a/src/control/rivers-standalone/river.F90 b/src/control/rivers-standalone/river.F90 index 55bf51b1..dcb32c86 100644 --- a/src/control/rivers-standalone/river.F90 +++ b/src/control/rivers-standalone/river.F90 @@ -33,7 +33,7 @@ PROGRAM river USE jules_print_mgr, ONLY: jules_message, jules_print -USE control_mod, ONLY: control +USE rivers_control_mod, ONLY: rivers_control !TYPE definitions USE jules_fields_mod, ONLY: psparms_data, psparms, & @@ -143,7 +143,7 @@ PROGRAM river !----------------------------------------------------------------------------- ! Call the main model science routine !----------------------------------------------------------------------------- - CALL control( & + CALL rivers_control( & !TYPES containing field data (IN OUT) psparms, ainfo, progs, fluxes, rivers, wtrac_jls ) diff --git a/src/control/rivers-standalone/control_mod.F90 b/src/control/rivers-standalone/rivers_control_mod.F90 similarity index 97% rename from src/control/rivers-standalone/control_mod.F90 rename to src/control/rivers-standalone/rivers_control_mod.F90 index 14d32fa3..b91f5257 100644 --- a/src/control/rivers-standalone/control_mod.F90 +++ b/src/control/rivers-standalone/rivers_control_mod.F90 @@ -1,4 +1,4 @@ -MODULE control_mod +MODULE rivers_control_mod ! *****************************COPYRIGHT**************************************** ! (c) Crown copyright, Met Office. All rights reserved. ! @@ -14,13 +14,13 @@ MODULE control_mod PRIVATE -PUBLIC :: control +PUBLIC :: rivers_control -CHARACTER(LEN=*), PARAMETER, PRIVATE :: ModuleName='CONTROL_MOD' +CHARACTER(LEN=*), PARAMETER, PRIVATE :: ModuleName='RIVERS_CONTROL_MOD' CONTAINS -SUBROUTINE control ( & +SUBROUTINE rivers_control ( & !TYPES containing field data (IN OUT) psparms, ainfo, progs, fluxes, river, wtrac_jls ) @@ -185,6 +185,6 @@ SUBROUTINE control ( & CALL jules_print(RoutineName, jules_message) END SELECT -END SUBROUTINE control +END SUBROUTINE rivers_control -END MODULE control_mod +END MODULE rivers_control_mod diff --git a/src/control/standalone/jules.F90 b/src/control/standalone/jules.F90 index fd1f8ae8..72972741 100644 --- a/src/control/standalone/jules.F90 +++ b/src/control/standalone/jules.F90 @@ -10,6 +10,8 @@ PROGRAM jules !$ USE omp_lib, ONLY: omp_get_max_threads +USE standalone_control_mod, ONLY: standalone_control + USE init_mod, ONLY: init USE io_constants, ONLY: max_file_name_len @@ -72,6 +74,8 @@ PROGRAM jules work_vars_data_cbl, work_vars_cbl USE imgn_drive_mod, ONLY: imgn_drive_data, imgn_drive USE imgn_vars_mod, ONLY: imgn_vars_data, imgn_vars +USE imogen_update_clim_mod, ONLY: imogen_update_clim +USE imogen_update_carb_mod, ONLY: imogen_update_carb IMPLICIT NONE @@ -191,7 +195,7 @@ PROGRAM jules !----------------------------------------------------------------------------- ! Call the main model science routine !----------------------------------------------------------------------------- - CALL control( & + CALL standalone_control( & ! Scalar arguments (INTENT IN) timestep_number, & ! Forcing (INTENT IN) diff --git a/src/control/standalone/control.F90 b/src/control/standalone/standalone_control_mod.F90 similarity index 99% rename from src/control/standalone/control.F90 rename to src/control/standalone/standalone_control_mod.F90 index 0542a79b..97703a60 100644 --- a/src/control/standalone/control.F90 +++ b/src/control/standalone/standalone_control_mod.F90 @@ -1,5 +1,12 @@ #if !defined(UM_JULES) -SUBROUTINE control ( & + +MODULE standalone_control_mod + +IMPLICIT NONE + +CONTAINS + +SUBROUTINE standalone_control ( & ! Scalar arguments (INTENT IN) timestep_number, & u_1_ij, v_1_ij, & @@ -911,5 +918,6 @@ SUBROUTINE control ( & work_cbl & ) -END SUBROUTINE control +END SUBROUTINE standalone_control +END MODULE standalone_control_mod #endif diff --git a/src/initialisation/standalone/init_fire.F90 b/src/initialisation/standalone/init_fire_mod.F90 similarity index 98% rename from src/initialisation/standalone/init_fire.F90 rename to src/initialisation/standalone/init_fire_mod.F90 index 8681971f..c57a6c1c 100644 --- a/src/initialisation/standalone/init_fire.F90 +++ b/src/initialisation/standalone/init_fire_mod.F90 @@ -5,6 +5,12 @@ ! which you should have received as part of this distribution. ! *****************************COPYRIGHT************************************** +MODULE init_fire_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE init_fire(nml_dir,land_index) USE io_constants, ONLY: namelist_unit @@ -100,4 +106,5 @@ SUBROUTINE init_fire(nml_dir,land_index) RETURN END SUBROUTINE init_fire +END MODULE init_fire_mod #endif diff --git a/src/initialisation/standalone/init_imogen.F90 b/src/initialisation/standalone/init_imogen_mod.F90 similarity index 99% rename from src/initialisation/standalone/init_imogen.F90 rename to src/initialisation/standalone/init_imogen_mod.F90 index e9e3e1b2..d02ff279 100644 --- a/src/initialisation/standalone/init_imogen.F90 +++ b/src/initialisation/standalone/init_imogen_mod.F90 @@ -5,6 +5,11 @@ ! which you should have received as part of this distribution. ! *****************************COPYRIGHT************************************** +MODULE init_imogen_mod + +IMPLICIT NONE + +CONTAINS SUBROUTINE init_imogen(nml_dir, progs_data, trifctltype, imgn_drive, & imgn_vars, ainfo) @@ -39,6 +44,8 @@ SUBROUTINE init_imogen(nml_dir, progs_data, trifctltype, imgn_drive, & USE imogen_anlg_vals, ONLY: imogen_anlg_vals_list, file_clim, file_patt, & diff_frac_const_imogen +USE imogen_check_mod, ONLY: imogen_check + USE imogen_io_vars, ONLY: nyr_max, yr_emiss, c_emiss USE aero, ONLY: co2_mmr @@ -386,4 +393,5 @@ SUBROUTINE init_imogen(nml_dir, progs_data, trifctltype, imgn_drive, & RETURN END SUBROUTINE init_imogen +END MODULE init_imogen_mod #endif diff --git a/src/initialisation/standalone/init_irrigation.F90 b/src/initialisation/standalone/init_irrigation_mod.F90 similarity index 97% rename from src/initialisation/standalone/init_irrigation.F90 rename to src/initialisation/standalone/init_irrigation_mod.F90 index d3ab3d14..434d8c04 100644 --- a/src/initialisation/standalone/init_irrigation.F90 +++ b/src/initialisation/standalone/init_irrigation_mod.F90 @@ -5,6 +5,11 @@ ! which you should have received as part of this distribution. ! *****************************COPYRIGHT************************************** +MODULE init_irrigation_mod + +IMPLICIT NONE + +CONTAINS SUBROUTINE init_irrigation(nml_dir) @@ -79,4 +84,5 @@ SUBROUTINE init_irrigation(nml_dir) RETURN END SUBROUTINE init_irrigation +END MODULE init_irrigation_mod #endif diff --git a/src/initialisation/standalone/init.F90 b/src/initialisation/standalone/init_mod.F90 similarity index 98% rename from src/initialisation/standalone/init.F90 rename to src/initialisation/standalone/init_mod.F90 index f96a37ed..f94cdc16 100644 --- a/src/initialisation/standalone/init.F90 +++ b/src/initialisation/standalone/init_mod.F90 @@ -5,7 +5,11 @@ ! *****************************COPYRIGHT************************************** MODULE init_mod + +IMPLICIT NONE + CONTAINS + SUBROUTINE init(nml_dir, crop_vars_data, crop_vars, & psparms_data, psparms, & toppdm, top_pdm_data, & @@ -72,6 +76,12 @@ SUBROUTINE init(nml_dir, crop_vars_data, crop_vars, & USE check_compatible_options_mod, ONLY: check_compatible_options USE init_deposition_mod, ONLY: init_deposition USE jules_science_fixes_mod, ONLY: init_science_fixes +USE init_irrigation_mod, ONLY: init_irrigation +USE init_urban_mod, ONLY: init_urban +USE init_fire_mod, ONLY: init_fire +USE init_imogen_mod, ONLY: init_imogen +USE init_prescribed_data_mod, ONLY: init_prescribed_data +USE init_vars_tmp_mod, ONLY: init_vars_tmp ! Get fields for veg3_init USE jules_surface_types_mod, ONLY: npft, nnpft, ntype diff --git a/src/initialisation/standalone/init_prescribed_data.F90 b/src/initialisation/standalone/init_prescribed_data_mod.F90 similarity index 99% rename from src/initialisation/standalone/init_prescribed_data.F90 rename to src/initialisation/standalone/init_prescribed_data_mod.F90 index 7853b085..f6d24f4a 100644 --- a/src/initialisation/standalone/init_prescribed_data.F90 +++ b/src/initialisation/standalone/init_prescribed_data_mod.F90 @@ -5,6 +5,11 @@ ! which you should have received as part of this distribution. ! *****************************COPYRIGHT************************************** +MODULE init_prescribed_data_mod + +IMPLICIT NONE + +CONTAINS SUBROUTINE init_prescribed_data(nml_dir) @@ -729,4 +734,5 @@ SUBROUTINE init_prescribed_data(nml_dir) RETURN END SUBROUTINE init_prescribed_data +END MODULE init_prescribed_data_mod #endif diff --git a/src/initialisation/standalone/init_urban.F90 b/src/initialisation/standalone/init_urban_mod.F90 similarity index 94% rename from src/initialisation/standalone/init_urban.F90 rename to src/initialisation/standalone/init_urban_mod.F90 index cb6edbfb..9026af19 100644 --- a/src/initialisation/standalone/init_urban.F90 +++ b/src/initialisation/standalone/init_urban_mod.F90 @@ -5,6 +5,11 @@ ! which you should have received as part of this distribution. ! *****************************COPYRIGHT************************************** +MODULE init_urban_mod + +IMPLICIT NONE + +CONTAINS SUBROUTINE init_urban(nml_dir) @@ -39,4 +44,5 @@ SUBROUTINE init_urban(nml_dir) RETURN END SUBROUTINE init_urban +END MODULE init_urban_mod #endif diff --git a/src/initialisation/standalone/init_vars_tmp.F90 b/src/initialisation/standalone/init_vars_tmp_mod.F90 similarity index 99% rename from src/initialisation/standalone/init_vars_tmp.F90 rename to src/initialisation/standalone/init_vars_tmp_mod.F90 index c0dc8c05..d6a27cb8 100644 --- a/src/initialisation/standalone/init_vars_tmp.F90 +++ b/src/initialisation/standalone/init_vars_tmp_mod.F90 @@ -1,5 +1,11 @@ #if !defined(UM_JULES) +MODULE init_vars_tmp_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE init_vars_tmp(crop_vars,psparms,toppdm,ainfo,trif_vars, aerotype, & progs, trifctltype, coast, jules_vars, & !fluxes, & @@ -323,4 +329,5 @@ SUBROUTINE init_vars_tmp(crop_vars,psparms,toppdm,ainfo,trif_vars, aerotype, & RETURN END SUBROUTINE init_vars_tmp +END MODULE init_vars_tmp_mod #endif diff --git a/src/science/vegetation/crop_mod.F90 b/src/science/vegetation/crop_mod.F90 index a6269985..c688ee62 100644 --- a/src/science/vegetation/crop_mod.F90 +++ b/src/science/vegetation/crop_mod.F90 @@ -58,6 +58,14 @@ SUBROUTINE crop(p_field, land_pts, land_index, a_step, & USE ancil_info, ONLY: nsurft, nsoilt +USE sow_mod, ONLY: sow + +USE emerge_mod, ONLY: emerge + +USE develop_mod, ONLY: develop + +USE partition_mod, ONLY: partition + IMPLICIT NONE !----------------------------------------------------------------------------- diff --git a/src/science/vegetation/develop.F90 b/src/science/vegetation/develop_mod.F90 similarity index 97% rename from src/science/vegetation/develop.F90 rename to src/science/vegetation/develop_mod.F90 index b1c8ce11..21f43960 100644 --- a/src/science/vegetation/develop.F90 +++ b/src/science/vegetation/develop_mod.F90 @@ -4,6 +4,11 @@ ! which you should have received as part of this distribution. ! *****************************COPYRIGHT******************************* +MODULE develop_mod + +IMPLICIT NONE + +CONTAINS SUBROUTINE develop(n, t_surft, phot, tt_veg, tt_rep, dvi) @@ -92,3 +97,4 @@ SUBROUTINE develop(n, t_surft, phot, tt_veg, tt_rep, dvi) END IF END SUBROUTINE develop +END MODULE develop_mod diff --git a/src/science/vegetation/emerge.F90 b/src/science/vegetation/emerge_mod.F90 similarity index 96% rename from src/science/vegetation/emerge.F90 rename to src/science/vegetation/emerge_mod.F90 index c4e3617c..d74f70b9 100644 --- a/src/science/vegetation/emerge.F90 +++ b/src/science/vegetation/emerge_mod.F90 @@ -4,6 +4,12 @@ ! which you should have received as part of this distribution. ! *****************************COPYRIGHT******************************* +MODULE emerge_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE emerge(n, t_surft, dvi) USE conversions_mod, ONLY: rsec_per_day @@ -58,3 +64,4 @@ SUBROUTINE emerge(n, t_surft, dvi) dvi = dvi + ( teff / tt_emr(n) ) END SUBROUTINE emerge +END MODULE emerge_mod diff --git a/src/science/vegetation/partition.F90 b/src/science/vegetation/partition_mod.F90 similarity index 98% rename from src/science/vegetation/partition.F90 rename to src/science/vegetation/partition_mod.F90 index b543097c..a73d55aa 100644 --- a/src/science/vegetation/partition.F90 +++ b/src/science/vegetation/partition_mod.F90 @@ -4,6 +4,11 @@ ! which you should have received as part of this distribution. ! *****************************COPYRIGHT******************************* +MODULE partition_mod + +IMPLICIT NONE + +CONTAINS SUBROUTINE partition(n, npp_ft_acc, dvi, rootc, harvc, reservec, & nonyield_diag, stemc, leafc, harv_count, harv_trig) @@ -155,3 +160,4 @@ SUBROUTINE partition(n, npp_ft_acc, dvi, rootc, harvc, reservec, & END SUBROUTINE partition +END MODULE partition_mod diff --git a/src/science/vegetation/sow.F90 b/src/science/vegetation/sow_mod.F90 similarity index 98% rename from src/science/vegetation/sow.F90 rename to src/science/vegetation/sow_mod.F90 index b7c7b998..9964ba6d 100644 --- a/src/science/vegetation/sow.F90 +++ b/src/science/vegetation/sow_mod.F90 @@ -4,6 +4,12 @@ ! which you should have received as part of this distribution. ! *****************************COPYRIGHT******************************* +MODULE sow_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE sow(n, sm_levels, t_soil, sthu, smvcst, smvccl, dphotdt, & sowdate, dvi) @@ -98,3 +104,4 @@ SUBROUTINE sow(n, sm_levels, t_soil, sthu, smvcst, smvccl, dphotdt, & END IF END SUBROUTINE sow +END MODULE sow_mod diff --git a/src/util/logging_mod.F90 b/src/util/logging_mod.F90 index eb1d0d06..c6046412 100644 --- a/src/util/logging_mod.F90 +++ b/src/util/logging_mod.F90 @@ -10,7 +10,7 @@ MODULE logging_mod USE jules_vars_mod, ONLY: mpi_local_comm -USE ISO_FORTRAN_ENV, ONLY: OUTPUT_UNIT, ERROR_UNIT +USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY: OUTPUT_UNIT, ERROR_UNIT IMPLICIT NONE