# How are fields sent from radintg.F90 to radiation\_scheme.F90?

**URL:** <https://forum.ecmwf.int/t/how-are-fields-sent-from-radintg-f90-to-radiation-scheme-f90/12174>\
**Category:** OpenIFS\
**Tags:** openifs-43r3, openifs-aerosol-processes, openifs-radiation, openifs-physics-parametrizations\
**Created:** [3 April 2023 14:53 UTC](https://forum.ecmwf.int/t/how-are-fields-sent-from-radintg-f90-to-radiation-scheme-f90/12174 "2023-04-03T14:53:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joakim\_Kjellsson](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@Joakim\_Kjellsson](https://forum.ecmwf.int/u/Joakim_Kjellsson)\
**Post date:** [3 April 2023 14:53 UTC](https://forum.ecmwf.int/t/how-are-fields-sent-from-radintg-f90-to-radiation-scheme-f90/12174/1 "2023-04-03T14:53:46Z")

</div>

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.&nbsp;

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

---

<div class="post-metadata">

**Author:** ![Peter\_Ukkonen](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/p/439d5e/32.png) [@Peter\_Ukkonen](https://forum.ecmwf.int/u/Peter_Ukkonen)\
**Post date:** [1 May 2023 08:28 UTC](https://forum.ecmwf.int/t/how-are-fields-sent-from-radintg-f90-to-radiation-scheme-f90/12174/2 "2023-05-01T08:28:14Z")

</div>

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](https://stackoverflow.com/questions/57063755/fortran-passing-array-using-starting-index-only)
