@@ -652,24 +652,42 @@ int F_VAR, FSPLIT_VAR;
652652 // Note: When changing the FunctionBegin declarations below,
653653 // the number of arguments minus one must be changed in DefFnc here
654654 // as well. (hplin, 7/6/22)
655- F_VAR = DefFnc ( "Fun" , 5 ,
656- "time derivatives of variables - Aggregate form" );
657-
658- FSPLIT_VAR = DefFnc ( "Fun_SPLIT" , 7 ,
659- "time derivatives of variables - Split form" );
660-
655+ //
656+ // For F90, add an extra argument to Fun and Fun_Split to return
657+ // the Aout array. (hplin, bmy, 30 Apr 2024)
658+ if (useLang == F90_LANG ) {
659+ F_VAR = DefFnc ("Fun" , 5 ,
660+ "time derivatives of variables - Aggregate form" );
661+ FSPLIT_VAR = DefFnc ("Fun_SPLIT" , 7 ,
662+ "time derivatives of variables - Split form" );
663+ } else {
664+ F_VAR = DefFnc ("Fun" , 4 ,
665+ "time derivatives of variables - Aggregate form" );
666+ FSPLIT_VAR = DefFnc ("Fun_SPLIT" , 6 ,
667+ "time derivatives of variables - Split form" );
668+ }
661669
662670 // We have added the capability to return equation rates and the
663671 // time derivative of variable species from Fun via optional arguments
664672 // Aout and VdotOut (when z_useAggregate=1)
665673 // -- Bob Yantosca (03 May 2022)
666674 //
667675 // Vdotout functionality can be accomplished using Vdot (hplin, 7/6/22)
676+ //
677+ // F90 needs Fun to have an extra argument for Aout (hplin, bmy, 30 Apr 2024)
668678 if ( z_useAggregate ) {
669- FunctionBegin ( F_VAR , V , F , RCT , Vdot , Aout );
679+ if (useLang == F90_LANG ) {
680+ FunctionBegin ( F_VAR , V , F , RCT , Vdot , Aout );\
681+ } else {
682+ FunctionBegin ( F_VAR , V , F , RCT , Vdot );
683+ }
670684 }
671685 else {
672- FunctionBegin ( FSPLIT_VAR , V , F , RCT , Vdot , P_VAR , D_VAR , Aout );
686+ if (useLang == F90_LANG ) {
687+ FunctionBegin ( FSPLIT_VAR , V , F , RCT , Vdot , P_VAR , D_VAR , Aout );
688+ } else {
689+ FunctionBegin ( FSPLIT_VAR , V , F , RCT , Vdot , P_VAR , D_VAR );
690+ }
673691 }
674692
675693 if ( (useLang == MATLAB_LANG )&& (!z_useAggregate ) )
0 commit comments