earth-system-radiation/rte-rrtmgp

GNU bug and array temporaries

Closed this issue · 3 comments

There's a GNU bug in examples/all-sky/mo_garand_atmos_io.F90 for GNU wherein you cannot pass arrays of string literals that have different lengths. Workaround is to create a temporary: character(len=32) :: strtmp(2), and assign a dim name to each index and then use the temporary.

Also, there are array temporaries being created in the following places:

At line 234 of file ../rrtmgp/kernels/mo_gas_optics_kernels.F90
Fortran runtime warning: An array temporary was created for argument 'gpt_flv' of procedure 'gas_optical_depths_minor'
At line 254 of file ../rrtmgp/kernels/mo_gas_optics_kernels.F90
Fortran runtime warning: An array temporary was created for argument 'gpt_flv' of procedure 'gas_optical_depths_minor'
At line 187 of file ../rte/kernels/mo_rte_solver_kernels.F90
Fortran runtime warning: An array temporary was created for argument 'inc_flux' of procedure 'apply_bc_gpt'
+ ./rrtmgp_clouds rrtmgp-clouds.nc /home/temp/rte-rrtmgp/rrtmgp/data/rrtmgp-data-sw-g224-2018-12-04.nc /home/temp/rte-rrtmgp/extensions/cloud_optics/rrtmgp-cloud-optics-coeffs-sw.nc 3000
At line 234 of file ../rrtmgp/kernels/mo_gas_optics_kernels.F90
Fortran runtime warning: An array temporary was created for argument 'gpt_flv' of procedure 'gas_optical_depths_minor'
At line 254 of file ../rrtmgp/kernels/mo_gas_optics_kernels.F90
Fortran runtime warning: An array temporary was created for argument 'gpt_flv' of procedure 'gas_optical_depths_minor'

These can be worked around by using an array you create yourself, copying the data into it, and passing the new array.

@mrnorman Can you let me know which commit this applies to, and which branch, and which line? I want to understand how this isn't being caught in our continuous integration.

Files are above, branch is master, I'm at home right now, but line number is where you have string literals in an array: ['dim', 'longerdim'], and they have to be the same length.