Good afternoon

I'm working on putting in the MACv2-SP aerosol properties in OpenIFS. This requires computing aerosol optical depth in a separate routine and sending to the radiation scheme, ecRAD.
I'm reading in data from a netCDF file and then I've added a new array as an argument to "CALL RADIATION_SCHEME" in radintg.F90.

However, I'm struggling to understand the size of the arrays in this subroutine.

As I understand, each array, e.g. aerosol mixing ratio, has a size of NX, NLEV, where NX is the size of the global horizontal grid (40320 for Tco95) and NLEV is number of levels (usually 91).

Then each array is decomposed into one smaller array for each MPI task, so that the array now has size NGPTOT, KLEV.

There is also a further decomposition into blocks, so that in radintg.F90, arrays are of size NRPROMA, KLEV, NBLOCK.

But when RADIATION_SCHEME is called, it seems that only single numbers, not arrays, are sent and received (from radintg.F90):

!$OMP PARALLEL DO SCHEDULE(DYNAMIC,1)&
!$OMP&PRIVATE(JRL,IBEG,IEND,IL,IB)
DO JRL=1,RADGRID%NGPTOT,NRPROMA

IBEG=JRL
IEND=MIN(IBEG+NRPROMA-1,RADGRID%NGPTOT)
IL=IEND-IBEG+1
IB=(JRL-1)/NRPROMA+1

....

! Use the modular radiation scheme
CALL RADIATION_SCHEME &
& (1, IL, NRPROMA, KLEV, IRADAER, &
& ZRII0, &
& ZRGP(1,IAMU0,IB), ZRGP(1,ITS,IB), ZRGP(1,IALD,IB), ZRGP(1,IALP,IB), &
& ZRGP(1,IALTE,IB), ZRGP(1,IALTW,IB), &
& ZRGP(1,ICCNL,IB), ZRGP(1,ICCNO,IB) ,&
& ZRGP(1,IGELAM,IB),ZRGP(1,IGEMU,IB), ZRGP(1,ISLM,IB), &
& ZRGP(1,IPR,IB), ZRGP(1,ITI,IB), &
& ZRGP(1,IAPRS,IB), ZRGP(1,IHTI,IB), &
& ZRGP(1,IWV,IB), ZRGP(1,ICO2,IB), ZRGP(1,ICH4,IB), ZRGP(1,IN2O,IB), &
& ZRGP(1,INO2,IB), ZRGP(1,IC11,IB), ZRGP(1,IC12,IB), ZRGP(1,IC22,IB), &
& ZRGP(1,ICL4,IB), ZRGP(1,IOZ,IB), &
& ZRGP(1,ICLC,IB), ZRGP(1,ILWA,IB), ZRGP(1,IIWA,IB), ZRGP(1,IRWA,IB), &
& ZRGP(1,ISWA,IB), &
& ZRGP(1,IAER,IB), ZRGP(1,IAERO,IB), &
& ZSIMPLE_PLUMES(1,1,1,IB), &
! Flux outputs
& ZRGP(1,IFRSO,IB), ZRGP(1,IFRTH,IB), ZRGP(1,ISWFC,IB),ZRGP(1,ILWFC,IB),&
& ZRGP(1,IFRSOD,IB),ZRGP(1,IFRTED,IB), &
& ZRGP(1,IFRSODC,IB),ZRGP(1,IFRTEDC,IB),&
& ZRGP(1,IFDIR,IB), ZRGP(1,ICDIR,IB), ZRGP(1,ISUDU,IB), &
& ZRGP(1,IUVDF,IB), ZRGP(1,IPARF,IB), &
& ZRGP(1,IPARCF,IB),ZRGP(1,ITINCF,IB), &
& ZRGP(1,IEMIT,IB) ,ZRGP(1,ILwDerivative,IB), &
& ZRGP(1,ISwDiffuseBand,IB), ZRGP(1,ISwDirectBand,IB),&
! OPTIONAL ARGUMENTS
& ZRGP(1,IPERT,IB))

ENDDO
!$OMP END PARALLEL DO

In radiation_scheme.F90, however, the input arguments are of size NRPROMA, LEV.

Similarly for the output, the array PSWDIFFUSEBAND(KLON,YRERAD%NSW) in radiation_scheme.F90 is 2D, but the argument to CALL RADIATION_SCHEME above is just ZRGP(1,ISwDiffuseBand, IB) which is just one number.

Since the model works, I'm clearly missing something here. 

My question is: Shouldn't the fields above be sent as 2D or 3D fields, rather than just single numbers?

If I have an array of size NRPROMA x KLEV in radintg.F90, how do I send this to radiation_scheme?

Many thanks
Joakim

1 Comment

  1. Hello, I also find this un-intuitive but turns out it's an alternative way of passing arrays in Fortran by just using the starting index (in this case for a section of a monolithic array): https://stackoverflow.com/questions/57063755/fortran-passing-array-using-starting-index-only