Skip to content
Open
5 changes: 2 additions & 3 deletions applications/lfricinputs/fortitude.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
file-extensions= ["f90", "F90", "X90", "x90", "pf"] #check these file types


select = ["E000", "E001", "C001", "C021", "C022", "C031", "C032", "C043",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if removing C043 is a good idea unless I have missed a good technical reason to do so. Doesn't it make more sense to specify the intent of an I/O function to the compiler as to give it more information and avoid dynamic allocation at runtime?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C043 is removed alongside C031, C032, C051, C082 (see description above) because they are all preview rules and not being used yet, but producing warnings. They'll be re-added with another ticket with the move to the latest fortitude version.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy this makes sense as it would me more useful for the rules to fail loudly in production.

"C051", "C071", "C072", "C091", "C082", "C092", "C121",
select = ["E000", "E001", "C001", "C021", "C022",
"C071", "C072", "C091", "C092", "C121",
"C132", "C141", "OB011", "OB021", "OB051", "OB061", "MOD001", "MOD021",
"S101", "S071", "PORT011", "PORT012", "PORT021", "FORT001",
"FORT002", "FORT003", "FORT004", "FORT005"]
Expand All @@ -22,7 +22,6 @@ output-format = "grouped" #group results by file

"lfricinp_unit_handler_mod.f90" = ["C022"]
"lfricinp_gather_lfric_field_mod.f90" = ["C121"]
"read_from_file_mod.f90" = ["S071"]

# Leaving out for now (these rules are used in the universal config):
# C081, C061
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ subroutine read_from_file(dep_graph)
character(len=genpar_len) :: parlist
!
! Id of field to read from file
character(len=field_name_len) field_io_name
character(len=field_name_len) :: field_io_name

! Error code for reading parameter list
integer :: ioerr
Expand Down
10 changes: 3 additions & 7 deletions applications/shallow_water/fortitude.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,16 @@

file-extensions= ["f90", "F90", "X90", "x90", "pf"] #check these file types

select = ["E000", "C001", "C021", "C022", "C031", "C032", "C043",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to comment made about the C043 removal in applications/lfricinputs/fortitude.toml

"C051", "C061", "C071", "C072", "C081", "C091", "C082", "C092",
select = ["E000", "C001", "C021", "C022",
"C061", "C071", "C072", "C081", "C091", "C092",
"C132", "C141", "OB011", "OB021", "OB051", "OB061", "MOD001", "MOD021",
"S101", "S071", "PORT011", "PORT012", "PORT021", "FORT001",
"FORT002", "FORT003", "FORT004", "FORT005"]


output-format = "grouped" #group results by file

[check.per-file-ignores]

"galewsky_test_case_mod.F90" = ["MOD021"]


# Leaving out for now (these rules are used in the universal config):
# E001, C121


Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ subroutine galewsky_profile(lat, long, psi_loc, h_loc)
! Set denominator in eq(2) of Galewsky et al.
den = (l1 - lat0)*(l1 - lat1)
! Set u(lat) as per eq(2) of Galewsky et al.
if (den .lt. 0.0_r_def) then
if (den < 0.0_r_def) then
uu1 = umen*exp(1.0_r_def/den)
else
uu1 = 0.0_r_def
Expand All @@ -99,7 +99,7 @@ subroutine galewsky_profile(lat, long, psi_loc, h_loc)
! Set denominator in eq(2) of Galewsky et al.
den = (l2 - lat0)*(l2 - lat1)
! Set u(lat) as per eq(2) of Galewsky et al.
if (den .lt. 0.0_r_def) then
if (den < 0.0_r_def) then
uu2 = umen*exp(1.0_r_def/den)
else
uu2 = 0.0_r_def
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ module process_send_fields_2d_mod
call depository%get_field("r_ocean_fraction", r_ocean_fraction)

! Calculate the reciprocal of acc_step
! If this is the first step after writing a checkpoint then the division by
! If this is the first step after writing a checkpoint then the division by
! acc_step has already been done in accumulate_send_fields before
! the field was written to the restart file so we set r_acc_step=1
! as we still need to divide by sea-ice fraction and copy values from
! depository field (dep_fld) to fld ready for coupling.
! In this case acc_step will have been set to zero
! In this case acc_step will have been set to zero
! so we can use this as a test.

call modeldb%values%get_value( 'accumulation_steps', acc_step )
Expand Down Expand Up @@ -272,7 +272,7 @@ module process_send_fields_2d_mod
call invoke(set_reciprocal_type(r_sea_ice_frac_raw, sea_ice_fraction_ptr, ndata))

! Calculate the ocean fraction (for scaling ocean fluxes)
call invoke(set_r_ocean_fraction_type(r_ocean_fraction, sea_ice_fraction_ptr, ndata))
call invoke(set_r_ocean_fraction_type(r_ocean_fraction, sea_ice_fraction_ptr, ndata))

end subroutine save_marine_fractions

Expand Down
4 changes: 2 additions & 2 deletions interfaces/coupled_interface/source/coupler_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ subroutine generate_coupling_field_collections(cpl_snd_2d, &
! Multiple category entry (so will need a multidata lfric field)
if (index_cat > 0) then
! Check if name ends in cpl_cat substring followed by 2 characters
if (len(trim(name)) - index_cat+1 - len(cpl_cat) .ne. 2 ) then
if (len(trim(name)) - index_cat+1 - len(cpl_cat) /= 2 ) then
write(log_scratch_space,'(3A)') &
"generate_coupling_field_collections : ", &
"incorrect send variable name in coupling config: ", name
Expand Down Expand Up @@ -836,7 +836,7 @@ subroutine generate_coupling_field_collections(cpl_snd_2d, &
index_cat = index(name, cpl_cat)
! if name ends in cpl_cat substring, check it is the correct length
if (index_cat > 0 .and. &
(index_cat - 1 + len(cpl_cat) + len(cpl_fixed_catno) .ne. &
(index_cat - 1 + len(cpl_cat) + len(cpl_fixed_catno) /= &
len(trim(name)))) then
write(log_scratch_space,'(3A)') &
"generate_coupling_field_collections : ", &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ subroutine set_r_ocean_fraction_code(nlayers, &
! Calculate the total sea ice fraction.
total_sea_ice_fraction = 0.0_r_def
do i = 1, n_sea_ice_tile
total_sea_ice_fraction = total_sea_ice_fraction + &
total_sea_ice_fraction = total_sea_ice_fraction + &
sea_ice_fraction(map_sea_ice(1) + i-1)
end do

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ subroutine value_based_mask(nlayers, mask, values, &
real(kind=r_def), intent(in) :: min_value, max_value


if ( (values(map_2d(1)) .ge. min_value) .and. &
(values(map_2d(1)) .le. max_value)) then
if ( (values(map_2d(1)) >= min_value) .and. &
(values(map_2d(1)) <= max_value)) then
mask(map_2d(1)) = 1.0_r_def
else
mask(map_2d(1)) = 0.0_r_def
Expand Down
6 changes: 2 additions & 4 deletions interfaces/jedi_lfric_interface/fortitude.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

file-extensions= ["f90", "F90", "X90", "x90", "pf"] #check these file types

select = ["E000", "C001", "C021", "C022", "C031", "C032", "C043",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to comment made about the C043 removal in applications/lfricinputs/fortitude.toml

"C051", "C061", "C071", "C072", "C091", "C082", "C092",
select = ["E000", "C001", "C021", "C022",
"C061", "C071", "C072", "C091", "C092",
"C132", "C141", "OB011", "OB021", "OB051", "OB061", "MOD001", "MOD021",
"S101", "S071", "PORT011", "PORT012", "PORT021", "FORT001",
"FORT002", "FORT003", "FORT004", "FORT005"]
Expand All @@ -18,8 +18,6 @@ output-format = "grouped" #group results by file

[check.per-file-ignores]

"jedi_lfric_linear_modeldb_driver_mod.f90" = ["S101"]
"atlas_field_interface_mod.F90" = ["S101"]
"jedi_lfric_field_meta_mod.f90" = ["C061"]
"jedi_lfric_wind_fields_mod.f90" = ["C061"]
"atlas_field_interface_test.pf" = ["C021"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ subroutine copy_from_lfric(self, return_code)
"Unexpected field type in atlas_field_interface_type%copy_from_lfric", &
log_level_error &
)
end select
end select

! Get indices for atlas and LFRic data
atlas_kstart = self % atlas_kstart
Expand Down Expand Up @@ -377,7 +377,7 @@ subroutine copy_to_lfric( self, return_code )
"Unexpected field type in atlas_field_interface_type%copy_to_lfric", &
log_level_error &
)
end select
end select

! Get indices for atlas and LFRic data
lfric_kstart = self%lfric_kstart
Expand Down Expand Up @@ -450,7 +450,7 @@ subroutine copy_from_lfric_ad(self)
"Unexpected field type in atlas_field_interface_type%copy_from_lfric_ad", &
log_level_error &
)
end select
end select

! Get indices for atlas and LFRic data
atlas_kstart = self % atlas_kstart
Expand Down Expand Up @@ -504,7 +504,7 @@ subroutine copy_to_lfric_ad( self )
"Unexpected field type in atlas_field_interface_type%copy_to_lfric_ad", &
log_level_error &
)
end select
end select

! Get indices for atlas and LFRic data
lfric_kstart = self%lfric_kstart
Expand Down Expand Up @@ -572,7 +572,7 @@ subroutine zero_lfric( self )
"Unexpected field type in atlas_field_interface_type%zero_lfric", &
log_level_error &
)
end select
end select

end subroutine zero_lfric

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ contains

if (surface == surface_jules) then
call surface_fields%get_field('sea_ice_thickness', sea_ice_thickness)
call surface_fields%get_field('tile_fraction', tile_fraction)
call surface_fields%get_field('tile_fraction', tile_fraction)
call surface_fields%get_field('tile_temperature', tile_temperature)

! Get the data from ancil_fields (if applicable for your model)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1721,7 +1721,7 @@ subroutine jules_exp_code(nlayers, seg_len, seg_len_halo, &

do n = 1, n_land_tile
do m = 1, sm_levels
i_tile=sm_levels*(n-1)+ m - 1
i_tile=sm_levels*(n-1)+ m - 1
do k = 1, ainfo%surft_pts(n)
l = ainfo%surft_index(k,n)
tile_water_extract(map_smtile(1,ainfo%land_index(l))+i_tile) = wt_ext_surft(l,m,n)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,7 @@ subroutine jules_extra_code( &
do n = 1, nsurft
do j = 1, nsmax
do l = 1, land_pts
i_snow = nsmax*(n-1) + j - 1
i_snow = nsmax*(n-1) + j - 1
! Thickness of snow layers
snow_layer_thickness(map_snow(1,ainfo%land_index(l))+i_snow) = real(progs%ds_surft(l,n,j), r_def)
! Mass of ice in snow layers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ subroutine jules_imp_code(nlayers, seg_len, &

do n = 1, n_land_tile
do m = 1, sm_levels
i_tile=sm_levels*(n-1) + m - 1
i_tile=sm_levels*(n-1) + m - 1
do k = 1, ainfo%surft_pts(n)
l = ainfo%surft_index(k,n)
wt_ext_surft(l,m,n) = tile_water_extract(map_smtile(1,ainfo%land_index(l))+i_tile)
Expand Down
11 changes: 5 additions & 6 deletions interfaces/physics_schemes_interface/fortitude.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

file-extensions= ["f90", "F90", "X90", "x90", "pf"] #check these file types

select = ["E000", "C001", "C031", "C032", "C043",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to comment made about the C043 removal in applications/lfricinputs/fortitude.toml

"C051", "C071", "C072", "C091", "C082", "C092",
"C132", "C141", "OB011", "OB021", "OB051", "OB061", "MOD001", "MOD021",
select = ["E000", "S101", "C001",
"C071", "C072", "C091", "C092",
"C132", "C141", "S071", "OB011", "OB021", "OB051", "OB061", "MOD001", "MOD021",
"PORT011", "PORT012", "PORT021", "FORT001",
"FORT002", "FORT003", "FORT004", "FORT005"]

Expand All @@ -23,9 +23,8 @@ output-format = "grouped" #group results by file
"fastjx_inphot_mod.f90" = ["C072"]
"umprintmgr.f90" = ["C072", "C132"]
"ukca_photol_param_mod.f90" = ["C072", "C132"]
"psykal_lite_phys_mod.F90" = ["C132", "MOD021"]
"um_sizes_init_mod.f90" = ["MOD021"]
"psykal_lite_phys_mod.F90" = ["C132"]

# Leaving out for now (these rules are used in the universal config):
# S101, C081, C021, C022, C061, S071, E001, C121
# C081, C021, C022, C061, E001, C121

Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ contains
chem_timestep, &
photol_scheme, photol_scheme_off, &
photol_scheme_prescribed, &
photol_scheme_fastjx
photol_scheme_fastjx

use sci_field_minmax_alg_mod, only: log_field_minmax
use microphysics_config_mod, only: microphysics_casim
Expand Down Expand Up @@ -117,7 +117,7 @@ contains
use um_sizes_init_mod, only: um_sizes_init
use um_ukca_init_mod, only: n_phot_spc, ratj_varnames
use ukca_photol_param_mod, only: jppj, jrate_fac, jp_names

use pseudo_photol_kernel_mod, only: pseudo_photol_kernel_type
use map_pseudophotol_kernel_mod, only: map_pseudophotol_kernel_type
use calc_albedo_kernel_mod, only: calc_albedo_kernel_type
Expand Down Expand Up @@ -165,7 +165,7 @@ contains

type( field_type ), pointer :: sw_up_tile
type( field_type ), pointer :: sw_down_surf

! Microphysics fields
type( field_type ), pointer :: ls_rain_3d
type( field_type ), pointer :: ls_snow_3d
Expand Down Expand Up @@ -428,7 +428,7 @@ contains
type( field_type ) :: sulp_aitken
type( field_type ) :: aod_sulp_accum
type( field_type ) :: aod_sulp_aitken

! Photolysis rates from Socrates - expected to be linked with
! photolysis_rates_rts field, which is currently a diagnostic
type( field_type ) :: photol_rates_rts_jo2
Expand Down Expand Up @@ -999,14 +999,14 @@ contains
if (microphysics_casim) then
call invoke(inc_X_plus_Y(mr_ice, mr(imr_ci)))
end if

! Fields needed by UKCA and Photolysis
call zh%copy_field_properties(conv_cloud_lwp)
call zh%copy_field_properties(surf_albedo)

call invoke( setval_c(conv_cloud_lwp, 0.0_r_def), &
setval_c(surf_albedo, 0.0_r_def) )

! Multi-dimensional field: photol_rates
vector_space=>function_space_collection%get_fs(mesh,0,0,Wtheta, &
get_ndata_val('photol_species') )
Expand All @@ -1016,15 +1016,15 @@ contains

if ( chem_scheme == chem_scheme_strattrop .and. &
photol_scheme /= photol_scheme_off ) then
! Photolysis currently linked to Strattrop
! Photolysis currently linked to Strattrop

! Sample Rates to output; wtheta grid
call ls_rain_3d%copy_field_properties(photol_rate_jo1d)
call ls_rain_3d%copy_field_properties(photol_rate_jno2)

call invoke( setval_c(photol_rate_jo1d, 0.0_r_def), &
setval_c(photol_rate_jno2, 0.0_r_def) )

! Only call photolysis if this is a chemistry timestep as photol rates
! are only used by chemistry
if (mod( model_clock%get_step(), &
Expand All @@ -1042,15 +1042,15 @@ contains
call ls_rain_3d%copy_field_properties(aod_sulp_aitken)
call ls_rain_3d%copy_field_properties(photol_rates_rts_jo2)
call ls_rain_3d%copy_field_properties(photol_rates_rts_jo2b)

call invoke ( setval_c(sulp_accum, 1.0e-25_r_def), &
setval_c(sulp_aitken, 1.0e-25_r_def), &
setval_c(aod_sulp_accum, 1.0e3_r_def), &
setval_c(aod_sulp_aitken, 1.0e3_r_def), &
setval_c(photol_rates_rts_jo2, 0.0_r_def), &
setval_c(photol_rates_rts_jo2b, 0.0_r_def) )

! Calculate Relative humidity (as fraction: 0.0-1.0)
! Calculate Relative humidity (as fraction: 0.0-1.0)
call mr(imr_v)%copy_field_properties(msat)
call mr(imr_v)%copy_field_properties(rel_humid_frac)
call invoke( setval_c(msat, 0.0_r_def), &
Expand All @@ -1061,7 +1061,7 @@ contains
inc_max_aX(0.0_r_def, rel_humid_frac), &
inc_min_aX(1.0_r_def, rel_humid_frac) )

! Derive required inputs, surface albedo first
! Derive required inputs, surface albedo first
call invoke ( calc_albedo_kernel_type ( surf_albedo, &
sw_down_surf, &
tile_fraction, &
Expand Down Expand Up @@ -1109,7 +1109,7 @@ contains
do jp1 = 1, n_phot_spc
select case(trim(ratj_varnames(jp1)))
case ('jo3a')
! jO(1D)
! jO(1D)
call invoke ( photol_diags_kernel_type(photol_rate_jo1d, &
jp1, &
photol_rates) )
Expand All @@ -1120,9 +1120,9 @@ contains
photol_rates) )
end select
end do

end if ! Fast-JX

! Specified photolysis rates - based on location and local time
if ( photol_scheme == photol_scheme_prescribed ) then
call ls_rain_3d%copy_field_properties(photol_rate_profile)
Expand Down Expand Up @@ -1151,9 +1151,9 @@ contains
end if ! photol_scheme = fastjx/ prescribed

if ( LPROF ) call stop_timing( id_photo, 'ukca.photolysis_alg' )

end if ! Chem timestep

end if ! Chem/ photolysis schemes

! Do UKCA time step
Expand Down Expand Up @@ -1567,7 +1567,7 @@ contains
if (photol_scheme /= photol_scheme_off ) then
call photol_rate_jo1d%write_field('chemistry__photol_rate_jo1d')
call photol_rate_jno2%write_field('chemistry__photol_rate_jno2')
end if
end if
end if ! chem_scheme_strattrop

call dms%write_field('chemistry__dms')
Expand Down
Loading
Loading