Changes between Version 5 and Version 6 of HowTo/FortranStandards


Ignore:
Timestamp:
2013-04-17T14:32:23+02:00 (11 years ago)
Author:
mmcgrath
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HowTo/FortranStandards

    v5 v6  
    1818> I don't understand this at all (BB) 
    1919>> This needs further clarification (JB) 
     20 
     21 
     221) For function/suroutine calls, there should only be five arguments per line. 
     23{{{ 
     24CALL subroutine(arg1, arg2, arg3, arg4, arg5, & 
     25                arg6, arg7, ... ) 
     26}}} 
     27 
     28The reason is that subroutine arguments are not strictly checked, so when one is hunting 
     29for bugs, it's nice to be able to quickly check that all the arguments are in the right place. 
     30 
     312) Related to point one, in the variable declaration of the subroutine, it's nice to have 
     32all the variables which are passed to/from to be in the same order as they are listed. 
     33{{{ 
     34SUBROUTINE subroutine(arg1, arg2, arg3, arg4, arg5, & 
     35                arg6, arg7, ... ) 
     36 
     37    ! 
     38    !! 0. Variable and parameter declaration 
     39    ! 
     40 
     41    ! 
     42    !! 0.1 Input variables 
     43    ! 
     44    INTEGER(i_std), INTENT(in)                                :: arg1         !! Domain size (unitless) 
     45    REAL(r_std), INTENT (in)                                  :: arg2         !! Time step (s) 
     46    REAL(r_std),DIMENSION (kjpindex), INTENT (in)             :: arg3         !! Downwelling short wave flux  
     47                                                   
     48   ! 
     49    !! 0.2 Output variables 
     50    ! 
     51    INTEGER(i_std), INTENT(out)                               :: arg4         !! Domain size (unitless) 
     52    REAL(r_std), INTENT (out)                                 :: arg5         !! Time step (s) 
     53    REAL(r_std),DIMENSION (kjpindex), INTENT (out)            :: arg6         !! Downwellin 
     54 
     55   !! 0.3 Modified variables 
     56    ! 
     57    INTEGER(i_std), INTENT(inout)                             :: arg7         !! Domain size (unitless) 
     58 
     59}}}