Quantcast
Channel: Intel® Software - Intel® Fortran Compiler for Linux* and macOS*
Viewing all 2746 articles
Browse latest View live

Segmentation fault when running code compiled with O2 option. Code using nested types with allocatable data and object oriented

$
0
0

We are developing a solver based on several structured grids which are connected.

For this reason some information is needed only in grid boundaries (face edges vertex).

To reduce the memory consumed we decided to the following structure:

TYPE single_neigh
    INTEGER :: num1, num2, num3

    INTEGER, allocatable, dimension(:) :: dirface
    contains
    procedure, public :: init
    procedure, public :: zeroing
    procedure, public :: getBlocAndIndexes
END TYPE

TYPE neigh_type
    INTEGER :: nb
    TYPE(single_neigh), ALLOCATABLE, DIMENSION(:) :: list

    contains
    procedure, public :: allocate_zero
    procedure, public :: change_size_keeping_data
    procedure, public :: check_size_type
    procedure, public :: copy_val
END TYPE neigh_type

Then we define a new type “neigh_type” with the neighborhood for each point

TYPE typebloc…
    TYPE(neigh_type), allocatable, dimension(:,:,:) :: PointsNeighs  ! for all grid points
END TYPE typebloc

 

Which is allocated with 

ALLOCATE(bloc_init(b1)%PointsNeighs(nx,ny,nz))

for the whole 3D grid, but only for the indices (ix, iy,iz) when information is needed

bloc_init(b)%PointsNeighs(ix,iy,iz)%list is updated using some “object oriented” procedure (change_size_keeping_data or allocate_zero).

 

The code then is something like this:

DO b = 1, number_of_grids
  DO iz = iz_min, iz_max
    DO iy = iy_min, iy_max
      DO ix = ix_min, ix_max
      ind = 0
         IF (bloc_init(b)%PointsNeighs(ix,iy,iz)%nb>0) THEN
            DO n = 1, bloc_init(b)%PointsNeighs(ix,iy,iz)%nb
               !!WRITE(*,*)bloc_init(b)%PointsNeighs(iu,iv,iw)%list(n)%point_type
               IF(bloc_init(b)%PointsNeighs(ix,iy,iz)%list(n)%num1 .EQ. (ind_edge)) THEN
               ind = ind + 1
               END IF
            END DO
        END IF
      END DO
    END DO
  END DO
END DO

 

The code works fine with Intel(R) Visual Fortran Composer XE 2013 SP1 Update 1 Integration for Microsoft Visual Studio* 2010, 14.0.0074.201

However with the compiler “composer_xe_2015.3.187“ in Linux the code works well in debug (O0) and O1 but fails in 02 and more complex release configurations with the error : forrtl: severe (174): SIGSEGV, segmentation fault occurred

Our tests show that the problem is in the last IF (line 09). If we uncomment the WRITE(*,*) in line 08 the code works. It seems then that the code does not “take the time” to access  …%list(n)

A corollary of this question is the efficiency of this program. The array list is deallocated and  reallocated each time its size change, is it then contiguous in memory? Are they some other issues?

Thread Topic: 

Question

Webinar on Accelerate Application Performance with OpenMP* and SIMD Parallelism

$
0
0

We welcome you all for the webinar tomorrow morning at 9am PST where Martyn Corden is going to show you how to tune a SAD kernel using Intel Software Tools. He will walk thru the steps on how to look for tuning opportunities and optimize the kernel step by step incrementally (also show performance improvement after each step). Please register at https://register.gotowebinar.com/register/5605160025455344642 to attend this webinar.

Faster compilation with Intel® Compiler 18.0 Beta

$
0
0

18.0 beta includes several improvements which may result in compile-time reduction for part of your application. In several cases, such a reduction may be significant, and cut compile time by more than 50%. This change is across all optimization levels, and is primarily noticeable for applications with a large number of small functions. While compile time is improved, runtime performance should not be affected. We invite you to try the Intel Fortran and C/C++ compilers 18.0 beta, part of the Parallel Studio XE 2018 beta.

More information about the Beta program is available here.

Example with kmp_malloc in Fortran

$
0
0

I am running the my fortran code across two NUMA nodes equipped by Xeon(R) CPU E5-2690v4 processors in Linux under SLURM. The part which uses MKL functions scales very good but my OpenMP code does not. I think it is due to the fact that I use a large memory allocated by the zero thread and then partitioned over the threads. In such a scenario, the memory is being allocated to on the node with thread 0. I believe that allocating the memory inside OpenMP threads will help to solve the problem. Could you please provide some examples of how this can be correctly done in Fortran? My attempts of doing it return zero pointers from kmp_malloc regardless the argument. 
P.S.
I saw a similar thread in forum, but it does not contain the solution. I use malloc, not ALLOCATE.
I was referred to the forum by the technical support, which we pay for. 

Thread Topic: 

How-To

Linking C++ with Fortran Co-arrays

$
0
0

Has anyone tried mixing C++ with Fortran co-arrays. I am trying to do so at the moment however it seems the "this_image()" and "num_images()" routines return a 0 for all cores, The main program is in C++ which calls a Fortran subroutine that contains those statements . There are no compilation errors or run time errors from these routines.

Thread Topic: 

Help Me

KMP_AFFINITY

$
0
0

Hi,

Does anyone know I can internally change KMP_AFFINITY in the sub-process invoked from my program?  My experiment shows it does not work with intel compiler but however it is under gcc compiler.

here is the example:

let's say I have KMP_AFFINITY=scatter, which is for my main process. Then inside main process before invoking another executable as the sub-process, putenv is used to modify KMP_AFFINITY=none for the sub-process.

is this supposed to work? my run shows the KMP_AFFINITY=none does not apply to the sub-process if intel compiler is used to compile and link my main program. but it is with gcc compiler.

when I double check the environment, in the sub-process, there is one extra environment variable for my exe with intel compiler

__KMP_REGISTERED_LIB_23907=0xacfa1d0-cafe8af0-libiomp5.a

 

what does this guy do and how to explain such difference? Thank you

Hongwei

Warning when -qopenmp is used

$
0
0

Dear,

I got the following warning when using ifort on a Linux computer, and I am wondering what it means, and how I can avoid it. I googled it, but I am not sure that I fully understood the problem.

The warning message I get is:

ifort: warning #10247: explicit static allocation of locals specified, overriding OpenMP*'s implicit auto allocation

The version of ifort is:

ifort (IFORT) 16.0.3 20160415
Copyright (C) 1985-2016 Intel Corporation.  All rights reserved.

The program that I compiled is:

program  essai
 implicit none
 integer::i,j,io,un

 print*,"Hello world"
contains

subroutine numlines(unfile,n)
 implicit none
 integer::io
 integer,intent(in)::unfile
 integer,intent(out)::n
 rewind(unfile)
 n=0
 do
  read(unfile,*,iostat=io)
  if (io.ne.0) exit
  n=n+1
 enddo
 rewind(unfile)
end subroutine

end program

and the command line is:

ifort -qopenmp essai.f90

I got the same warning message with more complex codes and command lines involving Openmp and MKL. I am compiling the same codes on other clusters with the same command lines without getting this warning. So, I am wondering why this warning appears on this specific computer, how I can avoid it, and what could be the consequences if I cannot avoid it.

In advance thank you.

Yours sincerely,

Jeremie

ifort command not found

$
0
0

I am working on ubuntu 14.04. I have ifort installed and works in bash. i have set environment. 

when i swtich to csh/ tcsh, i get ifort not installed. though i am not an expert, but i now its related to enviornment setting.

pl help.

 

thanks

 

ab

Thread Topic: 

Question

Equivalence

$
0
0

Hello,

I`m trying replace the equivalence in my code. Example:

    SUBROUTINE SPA88 (                                                                                                                      &
    & EXCTS   , CTSO3   , GXCTS   , SORC    , CSOUR   , CLDFAC  , TEMP    , PRESS   , VAR1         ,   &
    & VAR2     , P            , DELP      , DELP2   , TOTVO2  , TO3SP   , TO3SPC  , CO2SP1  , CO2SP2   ,   &
    & CO2SP)
!--------------------------------------------------------------------------------------------------
    USE PARMETA
    USE HCON
    USE PHYCON
    USE RNDDTA
!
    INCLUDE "MPP.h"
!
#include "sp.h"
!
    PARAMETER (L=LM)
    PARAMETER (IMAX=IM              , NCOL=IMAX)
    PARAMETER (NBLX=47)
    PARAMETER (NBLM=NBLY-1)
    PARAMETER (LP1=L+1               , LP2=L+2        , LP3=L+3)
    PARAMETER (LM1=L-1                , LM2=L-2        , LM3=L-3)
    PARAMETER (LL=2*L                   , LLP1=LL+1     , LLP2=LL+2, LLP3=LL+3)
    PARAMETER (LLM1=LL-1             , LLM2=LL-2     , LLM3=LL-3)
    PARAMETER (LP1M=LP1*LP1      , LP1M1=LP1M-1)
    PARAMETER (LP1V=LP1*(1+2*L/2))
    PARAMETER (LP121=LP1*NBLY)
    PARAMETER (LL3P=3*L+2)
    PARAMETER (NB=12)
    PARAMETER (INLTE=3                 ,INLTEP=INLTE+1  , NNLTE=56)
    PARAMETER (LP1I=IMAX*LP1      ,LLP1I=IMAX*LLP1, LL3PI=IMAX*LL3P)
    PARAMETER (NB1=NB-1)
    PARAMETER (KO2=12)
    PARAMETER (KO21=KO2+1         ,KO2M=KO2-1)
!
    DIMENSION SORC  (IDIM1:IDIM2, LP1 , NBLY), CSOUR (IDIM1:IDIM2, LP1)
    DIMENSION CLDFAC(IDIM1:IDIM2, LP1 , LP1)
    DIMENSION TEMP(IDIM1:IDIM2, LP1)       , PRESS (IDIM1:IDIM2, LP1)
    DIMENSION  VAR1(IDIM1:IDIM2, L)           ,   VAR2  (IDIM1:IDIM2, L)
    DIMENSION       P(IDIM1:IDIM2, LP1)        ,   DELP  (IDIM1:IDIM2, L)  ,  DELP2 (IDIM1:IDIM2, L)
!
    DIMENSION TOTVO2(IDIM1:IDIM2, LP1)       , TO3SPC(IDIM1:IDIM2, L)  ,  TO3SP (IDIM1:IDIM2, LP1)
!
    DIMENSION CO2SP1(IDIM1:IDIM2, LP1)       , CO2SP2(IDIM1:IDIM2, LP1),  CO2SP (IDIM1:IDIM2, LP1)
!
    DIMENSION EXCTS (IDIM1:IDIM2, L)         , CTSO3 (IDIM1:IDIM2, L)  , GXCTS (IDIM1:IDIM2)
!
    DIMENSION PHITMP(IDIM1:IDIM2, L)         , PSITMP(IDIM1:IDIM2, L)  ,              &
    &         TT    (IDIM1:IDIM2, L)         ,                                                                    &
    &         FAC1  (IDIM1:IDIM2, L)         , FAC2  (IDIM1:IDIM2, L)  ,                           &
    &         CTMP  (IDIM1:IDIM2, LP1)       , X     (IDIM1:IDIM2, L)  ,                          &
    &         Y     (IDIM1:IDIM2, L)         ,                                                    &
    &         TOPM  (IDIM1:IDIM2, L)         , TOPPHI(IDIM1:IDIM2, L)  ,                          &
    &         CTMP3 (IDIM1:IDIM2, LP1)       , CTMP2 (IDIM1:IDIM2, LP1)
!
    DIMENSION F     (IDIM1:IDIM2, L)         , FF    (IDIM1:IDIM2, L)  ,                          &
    &         AG    (IDIM1:IDIM2, L)         , AGG   (IDIM1:IDIM2, L)
!
!    EQUIVALENCE (F , AG , PHITMP)
!    EQUIVALENCE (FF, AGG, PSITMP)
!--------------------
! EQUIVALENCE REPLACE
!--------------------
    DO I=1,L
        AG(IDIM1:IDIM2,I) = TRANSFER( F(IDIM1:IDIM2,L),    AG(IDIM1:IDIM2,I))
    END DO
!
    DO I=1,L
    PHITMP(IDIM1:IDIM2,I) = TRANSFER( F(IDIM1:IDIM2,L),PHITMP(IDIM1:IDIM2,I))
    END DO
!
    DO I=1,L
       AGG(IDIM1:IDIM2,I) = TRANSFER(FF(IDIM1:IDIM2,L),   AGG(IDIM1:IDIM2,I))
    END DO
!
    DO I=1,L
    PSITMP(IDIM1:IDIM2,I) = TRANSFER(FF(IDIM1:IDIM2,L),PSITMP(IDIM1:IDIM2,I))
    END DO
!--------------------------------------------------------------------------------------------------
! COMPUTE TEMPERATURE QUANTITIES FOR USE IN PROGRAM
!--------------------------------------------------------------------------------------------------
    DO 101 K=1,L
        DO 101 I=MYIS,MYIE
            X(I,K) = TEMP(I,K) - H25E2
            Y(I,K) =    X(I,K) * X(I,K)
    101 END DO
!--------------------------------------------------------------------------------------------------
! INITIALIZE CTMP(I,1),CTMP2(I,1),CTMP3(I,1) TO UNITY; THESE ARE
! TRANSMISSION FCTNS AT THE TOP.
!--------------------------------------------------------------------------------------------------
    DO 345 I=MYIS,MYIE
        CTMP (I,1) = ONE
        CTMP2(I,1) = 1.
        CTMP3(I,1) = 1.
    345 END DO
!--------------------------------------------------------------------------------------------------
!***BEGIN LOOP ON FREQUENCY BANDS (1)***
!--------------------------------------------------------------------------------------------------
! CALCULATION FOR BAND 1 (COMBINED BAND 1)
!--------------------------------------------------------------------------------------------------
! OBTAIN TEMPERATURE CORRECTION (CAPPHI,CAPPSI),THEN MULTIPLY BY OPTICAL PATH (VAR1,VAR2) TO  
! COMPUTE TEMPERATURE-CORRECTED OPTICAL PATH AND MEAN PRESSURE FOR A LAYER (PHITMP,PSITMP)
!--------------------------------------------------------------------------------------------------
    DO 301 K=1,L
        DO 301 I=MYIS,MYIE
                  F(I,K) =  H44194M2  * (APCM   (1)    * X  (I,K)  + BPCM(1)  * Y(I,K))
                 FF(I,K) =  H44194M2  * (ATPCM  (1)    * X  (I,K)  + BTPCM(1) * Y(I,K))
                 AG(I,K) = (H1P41819  + F       (I,K)) * F  (I,K)  + ONE
                AGG(I,K) = (H1P41819  + FF      (I,K)) * FF (I,K)  + ONE
             PHITMP(I,K) =  VAR1(I,K) * (((( AG (I,K)  * AG (I,K))  ** 2) ** 2) **2)
             PSITMP(I,K) =  VAR2(I,K) * (((( AGG(I,K)  * AGG(I,K))  ** 2) ** 2) **2)
    301 END DO
!--------------------------------------------------------------------------------------------------
! OBTAIN OPTICAL PATH,MEAN PRESSURE FROM THE TOP TO THE PRESSURE
! P(K) (TOPM,TOPPHI)
!--------------------------------------------------------------------------------------------------
    DO 315 I=MYIS,MYIE
          TOPM(I,1) = PHITMP(I,1)
        TOPPHI(I,1) = PSITMP(I,1)
    315 END DO
    DO 319 K=2,L
        DO 317 I=MYIS,MYIE
              TOPM(I,K) =   TOPM(I,K-1) + PHITMP(I,K)
            TOPPHI(I,K) = TOPPHI(I,K-1) + PSITMP(I,K)
        317 END DO
    319 END DO
!--------------------------------------------------------------------------------------------------
! TT IS THE CLOUD-FREE CTS TRANSMISSION FUNCTION
!--------------------------------------------------------------------------------------------------
    DO 321 K=1,L
        DO 321 I=MYIS,MYIE
            FAC1(I,K)   = ACOMB(1)    *   TOPM(I,K)
            FAC2(I,K)   = FAC1 (I,K)  *   TOPM(I,K) / (BCOMB(1) * TOPPHI(I,K))
              TT(I,K)   = EXP  (HM1EZ *   FAC1(I,K) / SQRT  (1. + FAC2  (I,K)))
            CTMP(I,K+1) = TT   (I,K)  * CLDFAC(I,K+1,1)
    321 END DO
!--------------------------------------------------------------------------------------------------
! EXCTS IS THE CTS COOLING RATE ACCUMULATED OVER FREQUENCY BANDS
!--------------------------------------------------------------------------------------------------
    DO 353 K=1,L
        DO 353 I=MYIS,MYIE
            EXCTS(I,K) = SORC(I,K,1) * (CTMP(I,K+1) - CTMP(I,K))
    353 END DO
!--------------------------------------------------------------------------------------------------
! GXCTS IS THE EXACT CTS TOP FLUX ACCUMULATED OVER FREQUENCY BANDS
!--------------------------------------------------------------------------------------------------
    DO 361 I=MYIS,MYIE
        GXCTS(I) =  CLDFAC(I,LP1,1) * ( TT(I,L)      *  SORC(I,L,1)                               &
    &            + (HAF             * DELP(I,L)      * (  TT(I,LM1)    * (   P(I,LP1)             &
    &            - PRESS  (I,L))    + TT  (I,L)      * (   P(I,LP1)    + PRESS(I,L)               &
    &            - TWO              * P   (I,L))))   * (SORC(I,LP1,1)  -  SORC(I,L,1)))
    361 END DO
!--------------------------------------------------------------------------------------------------
! CALCULATION FOR BAND 2 (COMBINED BAND 2)
!--------------------------------------------------------------------------------------------------
!
!--------------------------------------------------------------------------------------------------
! OBTAIN TEMPERATURE CORRECTION (CAPPHI,CAPPSI),THEN MULTIPLY BY OPTICAL PATH (VAR1,VAR2) TO  
! COMPUTE TEMPERATURE-CORRECTED OPTICAL PATH AND MEAN PRESSURE FOR A LAYER (PHITMP,PSITMP)
!--------------------------------------------------------------------------------------------------
    DO 401 K=1,L
        DO 401 I=MYIS,MYIE
                 F(I,K) =  H44194M2  * (   APCM(2)    *   X(I,K)  + BPCM (2) * Y(I,K))
                FF(I,K) =  H44194M2  * (  ATPCM(2)    *   X(I,K)  + BTPCM(2) * Y(I,K))
                AG(I,K) = (H1P41819  +        F(I,K)) *   F(I,K)  + ONE
               AGG(I,K) = (H1P41819  +       FF(I,K)) *  FF(I,K)  + ONE
            PHITMP(I,K) =  VAR1(I,K) * ((((  AG(I,K)  *  AG(I,K)) ** 2) ** 2) ** 2)
            PSITMP(I,K) =  VAR2(I,K) * (((( AGG(I,K)  * AGG(I,k)) ** 2) ** 2) ** 2)
    401 END DO
!--------------------------------------------------------------------------------------------------
! OBTAIN OPTICAL PATH,MEAN PRESSURE FROM THE TOP TO THE PRESSURE
! P(K) (TOPM,TOPPHI)
!--------------------------------------------------------------------------------------------------
    DO 415 I=MYIS,MYIE
        TOPM  (I,1) = PHITMP(I,1)
        TOPPHI(I,1) = PSITMP(I,1)
    415 END DO
    DO 419 K=2,L
        DO 417 I=MYIS,MYIE
              TOPM(I,K) =   TOPM(I,K-1) + PHITMP(I,K)
            TOPPHI(I,K) = TOPPHI(I,K-1) + PSITMP(I,K)
        417 END DO
    419 END DO
!--------------------------------------------------------------------------------------------------
! TT IS THE CLOUD-FREE CTS TRANSMISSION FUNCTION
!--------------------------------------------------------------------------------------------------
    DO 421 K=1,L
        DO 421 I=MYIS,MYIE
            FAC1(I,K)   = ACOMB(2)    *   TOPM(I,K)
            FAC2(I,K)   =  FAC1(I,K)  *   TOPM(I,K) / (BCOMB(2) * TOPPHI(I,K))
              TT(I,K)   =   EXP(HM1EZ *   FAC1(I,K) / SQRT  (1. + FAC2  (I,K)))
            CTMP(I,K+1) =    TT(I,K)  * CLDFAC(I,K+1,1)
    421 END DO
!--------------------------------------------------------------------------------------------------
! EXCTS IS THE CTS COOLING RATE ACCUMULATED OVER FREQUENCY BANDS
!--------------------------------------------------------------------------------------------------  
    DO 453 K=1,L
        DO 453 I=MYIS,MYIE
            EXCTS(I,K) = EXCTS(I,K)   + SORC(I,K,2) * (CTMP(I,K+1) - CTMP(I,K))
    453 END DO
!--------------------------------------------------------------------------------------------------
! GXCTS IS THE EXACT CTS TOP FLUX ACCUMULATED OVER FREQUENCY BANDS
!--------------------------------------------------------------------------------------------------   
    DO 461 I=MYIS,MYIE
        GXCTS(I) = GXCTS(I)         + CLDFAC(I,LP1,1) * (  TT(I,L)      *  SORC(I,L,2)            &
    &            + (HAF             *   DELP(I,L)     * (  TT(I,LM1)    * (   P(I,LP1)            &
    &            - PRESS(I,L))      +     TT(I,L)     * (   P(I,LP1)    + PRESS(I,L)              &
    &            - TWO              *      P(I,L))))  * (SORC(I,LP1, 2) -  SORC(I,L,2)))
    461 END DO
!
!--------------------------------------------------------------------------------------------------
! CALCULATION FOR BAND 3 (COMBINED BAND 3)
!--------------------------------------------------------------------------------------------------
!--------------------------------------------------------------------------------------------------
! OBTAIN TEMPERATURE CORRECTION (CAPPHI,CAPPSI),THEN MULTIPLY BY OPTICAL PATH (VAR1,VAR2) TO  
! COMPUTE TEMPERATURE-CORRECTED OPTICAL PATH AND MEAN PRESSURE FOR A LAYER (PHITMP,PSITMP)
!--------------------------------------------------------------------------------------------------
    DO 501 K=1,L
        DO 501 I=MYIS,MYIE
                 F(I,K) =  H44194M2  * (   APCM(3)    *   X(I,K)  + BPCM (3)   * Y(I,K))
                FF(I,K) =  H44194M2  * (  ATPCM(3)    *   X(I,K)  + BTPCM(3)   * Y(I,K))
                AG(I,K) = (H1P41819  +        F(I,K)) *   F(I,K)  + ONE
               AGG(I,K) = (H1P41819  +       FF(I,K)) *  FF(I,K)  + ONE
            PHITMP(I,K) =  VAR1(I,K) * ((((  AG(I,K)  *  AG(I,K)) ** 2) ** 2) ** 2)
            PSITMP(I,K) =  VAR2(I,K) * (((( AGG(I,K)  * AGG(I,K)) ** 2) ** 2) ** 2)
    501 END DO
!--------------------------------------------------------------------------------------------------
! OBTAIN OPTICAL PATH,MEAN PRESSURE FROM THE TOP TO THE PRESSURE
! P(K) (TOPM,TOPPHI)
!--------------------------------------------------------------------------------------------------
    DO 515 I=MYIS,MYIE
          TOPM(I,1) = PHITMP(I,1)
        TOPPHI(I,1) = PSITMP(I,1)
    515 END DO
    DO 519 K=2,L
        DO 517 I=MYIS,MYIE
              TOPM(I,K) =   TOPM(I,K-1) + PHITMP(I,K)
            TOPPHI(I,K) = TOPPHI(I,K-1) + PSITMP(I,K)
        517 END DO
    519 END DO
!--------------------------------------------------------------------------------------------------
! TT IS THE CLOUD-FREE CTS TRANSMISSION FUNCTION
!--------------------------------------------------------------------------------------------------
    DO 521 K=1,L
        DO 521 I=MYIS,MYIE
            FAC1(I,K)   = ACOMB(3)    *   TOPM(I,K)
            FAC2(I,K)   =  FAC1(I,K)  *   TOPM(I,K)      / (BCOMB(3) * TOPPHI(I,K))
              TT(I,K)   =   EXP(HM1EZ *   FAC1(I,K)      / SQRT  (1. +   FAC2(I,K)))
            CTMP(I,K+1) =    TT(I,K)  * CLDFAC(I,K+1,1)
    521 END DO
!--------------------------------------------------------------------------------------------------
! EXCTS IS THE CTS COOLING RATE ACCUMULATED OVER FREQUENCY BANDS
!--------------------------------------------------------------------------------------------------
    DO 553 K=1,L
        DO 553 I=MYIS,MYIE
            EXCTS(I,K) = EXCTS(I,K) + SORC(I,K,3) * (CTMP(I,K+1) - CTMP(I,K))
    553 END DO
!--------------------------------------------------------------------------------------------------
! GXCTS IS THE EXACT CTS TOP FLUX ACCUMULATED OVER FREQUENCY BANDS
!--------------------------------------------------------------------------------------------------  
    DO 561 I=MYIS,MYIE
        GXCTS(I) = GXCTS(I)       + CLDFAC(I,LP1, 1) *  (TT(I,L)   *  SORC(I,L,3)                 &
    &            + (HAF           *   DELP(I,L)      * ( TT(I,LM1) * (   P(I,LP1)                 &
    &            - PRESS(I,L))   +      TT(I,L)      * (  P(I,LP1) + PRESS(I,L)    - TWO          &
    &            *     P(I,L)))) * (  SORC(I,LP1,3)  - SORC(I,L,3)))
    561 END DO
!--------------------------------------------------------------------------------------------------
! CALCULATION FOR BAND 4 (COMBINED BAND 4)
!--------------------------------------------------------------------------------------------------
!--------------------------------------------------------------------------------------------------
! OBTAIN TEMPERATURE CORRECTION (CAPPHI,CAPPSI),THEN MULTIPLY BY OPTICAL PATH (VAR1,VAR2) TO  
! COMPUTE TEMPERATURE-CORRECTED OPTICAL PATH AND MEAN PRESSURE FOR A LAYER (PHITMP,PSITMP)
!--------------------------------------------------------------------------------------------------
    DO 601 K=1,L
        DO 601 I=MYIS,MYIE
                 F(I,K) =  H44194M2   * (  APCM(4)     *   X(I,K)  + BPCM (4)    * Y(I,K))
                FF(I,K) =  H44194M2   * ( ATPCM(4)     *   X(I,K)  + BTPCM(4)    * Y(I,K))
                AG(I,K) = (H1P41819   +       F(I,K))  *   F(I,K)  + ONE
               AGG(I,K) = (H1P41819   +      FF(I,K))  *  FF(I,K)  + ONE
            PHITMP(I,K) =  VAR1(I,K)  * ((((  AG(I,K)  *  AG(I,K)) ** 2) ** 2) ** 2)
            PSITMP(I,K) =  VAR2(I,K)  * (((( AGG(I,K)  * AGG(I,K)) ** 2) ** 2) ** 2)
    601 END DO
!--------------------------------------------------------------------------------------------------
! OBTAIN OPTICAL PATH,MEAN PRESSURE FROM THE TOP TO THE PRESSURE
! P(K) (TOPM,TOPPHI)
!--------------------------------------------------------------------------------------------------
    DO 615 I=MYIS,MYIE
        TOPM  (I,1) = PHITMP(I,1)
        TOPPHI(I,1) = PSITMP(I,1)
    615 END DO
    DO 619 K=2,L
        DO 617 I=MYIS,MYIE
              TOPM(I,K) =   TOPM(I,K-1) + PHITMP(I,K)
            TOPPHI(I,K) = TOPPHI(I,K-1) + PSITMP(I,K)
        617 END DO
    619 END DO
!--------------------------------------------------------------------------------------------------
! TT IS THE CLOUD-FREE CTS TRANSMISSION FUNCTION
!--------------------------------------------------------------------------------------------------
    DO 621 K=1,L
        DO 621 I=MYIS,MYIE
            FAC1(I,K)   = ACOMB(4)    *   TOPM(I,K)
            FAC2(I,K)   =  FAC1(I,K)  *   TOPM(I,K)      / (BCOMB(4) * TOPPHI(I,K))
              TT(I,K)   =   EXP(HM1EZ *   FAC1(I,K)      / SQRT  (1. + FAC2  (I,K)))
            CTMP(I,K+1) =    TT (I,K) * CLDFAC(I,K+1,1)
    621 END DO
!--------------------------------------------------------------------------------------------------
! EXCTS IS THE CTS COOLING RATE ACCUMULATED OVER FREQUENCY BANDS
!--------------------------------------------------------------------------------------------------
    DO 653 K=1,L
        DO 653 I=MYIS,MYIE
            EXCTS(I,K) = EXCTS(I,K) + SORC(I,K,4) * (CTMP(I,K+1) - CTMP(I,K))
    653 END DO
!--------------------------------------------------------------------------------------------------
! GXCTS IS THE EXACT CTS TOP FLUX ACCUMULATED OVER FREQUENCY BANDS
!--------------------------------------------------------------------------------------------------
    DO 661 I=MYIS,MYIE
        GXCTS(I) = GXCTS(I)     + CLDFAC(I,LP1,1) * (  TT(I,L)     *  SORC(I,L,4)                 &
    &            + (HAF         *   DELP(I,L)     * (  TT(I,LM1)   * (   P(I,LP1)                 &
    &            - PRESS(I,L))  +     TT(I,L)     * (   P(I,LP1)   + PRESS(I,L)                   &
    &            - TWO          *      P(I,L))))  * (SORC(I,LP1,4) -  SORC(I,L,4)))
    661 END DO
!--------------------------------------------------------------------------------------------------
! CALCULATION FOR BAND 5 (COMBINED BAND 5)
!--------------------------------------------------------------------------------------------------
!--------------------------------------------------------------------------------------------------
! OBTAIN TEMPERATURE CORRECTION (CAPPHI,CAPPSI),THEN MULTIPLY BY OPTICAL PATH (VAR1,VAR2) TO  
! COMPUTE TEMPERATURE-CORRECTED OPTICAL PATH AND MEAN PRESSURE FOR A LAYER (PHITMP,PSITMP)
!--------------------------------------------------------------------------------------------------
    DO 701 K=1,L
        DO 701 I=MYIS,MYIE
                 F(I,K) =  H44194M2   * (   APCM(5)    *   X(I,K)  +  BPCM(5)    * Y(I,K))
                FF(I,K) =  H44194M2   * (  ATPCM(5)    *   X(I,K)  + BTPCM(5)    * Y(I,K))
                AG(I,K) = (H1P41819   +        F(I,K)) *   F(I,K)  + ONE
               AGG(I,K) = (H1P41819   +       FF(I,K)) *  FF(I,K)  + ONE
            PHITMP(I,K) =  VAR1(I,K)  * ((((  AG (I,K) *  AG(I,K)) ** 2) ** 2) ** 2)
            PSITMP(I,K) =  VAR2(I,K)  * (((( AGG(I,K)  * AGG(I,K)) ** 2) ** 2) ** 2)
    701 END DO
!--------------------------------------------------------------------------------------------------
! OBTAIN OPTICAL PATH,MEAN PRESSURE FROM THE TOP TO THE PRESSURE
! P(K) (TOPM,TOPPHI)
!--------------------------------------------------------------------------------------------------
    DO 715 I=MYIS,MYIE
          TOPM(I,1) = PHITMP(I,1)
        TOPPHI(I,1) = PSITMP(I,1)
    715 END DO
    DO 719 K=2,L
        DO 717 I=MYIS,MYIE
              TOPM(I,K) =   TOPM(I,K-1) + PHITMP(I,K)
            TOPPHI(I,K) = TOPPHI(I,K-1) + PSITMP(I,K)
        717 END DO
    719 END DO
!--------------------------------------------------------------------------------------------------
! TT IS THE CLOUD-FREE CTS TRANSMISSION FUNCTION
!--------------------------------------------------------------------------------------------------
    DO 721 K=1,L
        DO 721 I=MYIS,MYIE
            FAC1(I,K)   =  ACOMB(5)     *   TOPM(I,K)
            FAC2(I,K)   =   FAC1(I,K)   *   TOPM(I,K)   / (BCOMB(5)  * TOPPHI(I,K))
              TT(I,K)   =    EXP(HM1EZ  * ( FAC1(I,K)   /   SQRT(ONE +   FAC2(I,K))               &
    &                   + BETACM(5)     * TOTVO2(I,K+1) * SKO2D))
!             
            CTMP(I,K+1) =     TT(I,K)   * CLDFAC(I,K+1,1)
    721 END DO
!--------------------------------------------------------------------------------------------------
! EXCTS IS THE CTS COOLING RATE ACCUMULATED OVER FREQUENCY BANDS
!--------------------------------------------------------------------------------------------------
    DO 753 K=1,L
        DO 753 I=MYIS,MYIE
            EXCTS(I,K) = EXCTS(I,K) + SORC(I,K,5) * (CTMP(I,K+1) - CTMP(I,K))
    753 END DO
!--------------------------------------------------------------------------------------------------
! GXCTS IS THE EXACT CTS TOP FLUX ACCUMULATED OVER FREQUENCY BANDS
!--------------------------------------------------------------------------------------------------
    DO 761 I=MYIS,MYIE
        GXCTS(I) = GXCTS(I)         + CLDFAC(I,LP1,1)  * (  TT(I,L)      *  SORC(I,L,5)          &
    &            + (HAF             *   DELP(I,L)      * (  TT(I,LM1)    * (   P(I,LP1)           &  
    &            - PRESS(I,L))      +     TT(I,L)      * (   P(I,LP1)    + PRESS(I,L)             &
    &            - TWO              *      P(I,L))))   * (SORC(I,LP1,5)  -  SORC(I,L,5)))
    761 END DO
!--------------------------------------------------------------------------------------------------
! CALCULATION FOR BAND 6 (COMBINED BAND 6)
!--------------------------------------------------------------------------------------------------
!--------------------------------------------------------------------------------------------------
! OBTAIN TEMPERATURE CORRECTION (CAPPHI,CAPPSI),THEN MULTIPLY BY OPTICAL PATH (VAR1,VAR2) TO  
! COMPUTE TEMPERATURE-CORRECTED  OPTICAL PATH AND MEAN PRESSURE FOR A LAYER (PHITMP,PSITMP)
!--------------------------------------------------------------------------------------------------
    DO 801 K=1,L
        DO 801 I=MYIS,MYIE
                 F(I,K) =  H44194M2   * (   APCM(6)     *   X(I,K)  +  BPCM(6)    * Y(I,K))
                FF(I,K) =  H44194M2   * (  ATPCM(6)     *   X(I,K)  + BTPCM(6)    * Y(I,K))
                AG(I,K) = (H1P41819   +        F(I,K))  *   F(I,K)  + ONE
               AGG(I,K) = (H1P41819   +       FF(I,K))  *  FF(I,K)  + ONE
            PHITMP(I,K) =  VAR1(I,K)  * ((((  AG(I,K)   *  AG(I,K)) ** 2) ** 2) ** 2)
            PSITMP(I,K) =  VAR2(I,K)  * (((( AGG(I,K)   * AGG(I,K)) ** 2) ** 2) ** 2)
    801 END DO
!--------------------------------------------------------------------------------------------------
! OBTAIN OPTICAL PATH,MEAN PRESSURE FROM THE TOP TO THE PRESSURE
! P(K) (TOPM,TOPPHI)
!--------------------------------------------------------------------------------------------------
    DO 815 I=MYIS,MYIE
          TOPM(I,1) = PHITMP(I,1)
        TOPPHI(I,1) = PSITMP(I,1)
    815 END DO
    DO 819 K=2,L
        DO 817 I=MYIS,MYIE
              TOPM(I,K) =   TOPM(I,K-1) + PHITMP(I,K)
            TOPPHI(I,K) = TOPPHI(I,K-1) + PSITMP(I,K)
        817 END DO
    819 END DO
!--------------------------------------------------------------------------------------------------
! TT IS THE CLOUD-FREE CTS TRANSMISSION FUNCTION
!--------------------------------------------------------------------------------------------------
    DO 821 K=1,L
        DO 821 I=MYIS,MYIE
            FAC1(I,K)   =  ACOMB(6)    *   TOPM(I,K)
            FAC2(I,K)   =   FAC1(I,K)  *   TOPM(I,K)   / (BCOMB(6)  * TOPPHI(I,K))
              TT(I,K)   =    EXP(HM1EZ * ( FAC1(I,K)   /   SQRT(ONE +   FAC2(I,K))                &
    &                   + BETACM(6)    * TOTVO2(I,K+1) * SKO2D))
!
            CTMP(I,K+1) =     TT(I,K)  * CLDFAC(I,K+1,1)
    821 END DO
!--------------------------------------------------------------------------------------------------
! EXCTS IS THE CTS COOLING RATE ACCUMULATED OVER FREQUENCY BANDS
!--------------------------------------------------------------------------------------------------
    DO 853 K=1,L
        DO 853 I=MYIS,MYIE
            EXCTS(I,K)= EXCTS(I,K) + SORC(I,K,6) * (CTMP(I,K+1) - CTMP(I,K))
    853 END DO
!--------------------------------------------------------------------------------------------------
! GXCTS IS THE EXACT CTS TOP FLUX ACCUMULATED OVER FREQUENCY BANDS
!--------------------------------------------------------------------------------------------------
    DO 861 I=MYIS,MYIE
        GXCTS(I) = GXCTS(I)        + CLDFAC(I,LP1,1) * ( TT(I,L)   *  SORC(I,L,6)                 &
    &            + ( HAF           *   DELP(I,L)     * ( TT(I,LM1) * (   P(I,LP1)                 &
    &            - PRESS(I,L))     +     TT(I,L)     * (  P(I,LP1) + PRESS(I,L)   - TWO           &
    &            *     P(I,L))))   * ( SORC(I,LP1,6) - SORC(I,L,6)))
    861 END DO
!--------------------------------------------------------------------------------------------------
! CALCULATION FOR BAND 7 (COMBINED BAND 7)
!--------------------------------------------------------------------------------------------------
!--------------------------------------------------------------------------------------------------
! OBTAIN TEMPERATURE CORRECTION (CAPPHI,CAPPSI),THEN MULTIPLY BY OPTICAL PATH (VAR1,VAR2) TO  
! COMPUTE TEMPERATURE-CORRECTED OPTICAL PATH AND MEAN PRESSURE FOR A LAYER (PHITMP,PSITMP)
!--------------------------------------------------------------------------------------------------
    DO 901 K=1,L
        DO 901 I=MYIS,MYIE
                 F(I,K) =  H44194M2   * (   APCM(7)    *   X(I,K)   + BPCM (7) * Y(I,K))
                FF(I,K) =  H44194M2   * (  ATPCM(7)    *   X(I,K)   + BTPCM(7) * Y(I,K))
                AG(I,K) = (H1P41819   +        F(I,K)) *   F(I,K)   + ONE
               AGG(I,K) = (H1P41819   +       FF(I,K)) *  FF(I,K)   + ONE
            PHITMP(I,K) =  VAR1(I,K)  * ((((  AG(I,K)  *  AG (I,K)) ** 2) ** 2) ** 2)
            PSITMP(I,K) =  VAR2(I,K)  * (((( AGG(I ,K) * AGG(I,K))  ** 2) ** 2) ** 2)
    901 END DO
!--------------------------------------------------------------------------------------------------
! OBTAIN OPTICAL PATH,MEAN PRESSURE FROM THE TOP TO THE PRESSURE
! P(K) (TOPM,TOPPHI)
!--------------------------------------------------------------------------------------------------
    DO 915 I=MYIS,MYIE
          TOPM(I,1) = PHITMP(I,1)
        TOPPHI(I,1) = PSITMP(I,1)
    915 END DO
    DO 919 K=2,L
        DO 917 I=MYIS,MYIE
              TOPM(I,K) =   TOPM(I,K-1) + PHITMP(I,K)
            TOPPHI(I,K) = TOPPHI(I,K-1) + PSITMP(I,K)
        917 END DO
    919 END DO
!--------------------------------------------------------------------------------------------------
! TT IS THE CLOUD-FREE CTS TRANSMISSION FUNCTION
!--------------------------------------------------------------------------------------------------
    DO 921 K=1,L
        DO 921 I=MYIS,MYIE
            FAC1(I,K)   =   ACOMB(7)    *   TOPM(I,K)
            FAC2(I,K)   =    FAC1(I,K)  *   TOPM(I,K)   / (BCOMB(7)  * TOPPHI(I,K))
              TT(I,K)   =     EXP(HM1EZ * ( FAC1(I,K)   /   SQRT(ONE +   FAC2(I,K))               &
    &                    + BETACM(7)    * TOTVO2(I,K+1) * SKO2D))
!
            CTMP(I,K+1) =      TT(I,K)  * CLDFAC(I,K+1,1)
    921 END DO
!--------------------------------------------------------------------------------------------------
! EXCTS IS THE CTS COOLING RATE ACCUMULATED OVER FREQUENCY BANDS
!--------------------------------------------------------------------------------------------------
    DO 953 K=1,L
        DO 953 I=MYIS,MYIE
            EXCTS(I,K) = EXCTS(I,K) + SORC(I,K,7) * (CTMP(I,K+1) - CTMP(I,K))
    953 END DO
!--------------------------------------------------------------------------------------------------
! GXCTS IS THE EXACT CTS TOP FLUX ACCUMULATED OVER FREQUENCY BANDS
!--------------------------------------------------------------------------------------------------
    DO 961 I=MYIS,MYIE
        GXCTS(I) = GXCTS(I)     + CLDFAC(I,LP1,1) * (  TT(I,L)     *  SORC(I,L,7)                 &  
    &            + (HAF         *   DELP(I,L)     * (  TT(I,LM1)   * (   P(I,LP1)                 &
    &            - PRESS(I,L))  +     TT(I,L)     * (   P(I,LP1)   + PRESS(I,L)                   &
    &            - TWO          *      P(I,L))))  * (SORC(I,LP1,7) -  SORC(I,L,7)))
    961 END DO
!--------------------------------------------------------------------------------------------------
! CALCULATION FOR BAND 8 (COMBINED BAND 8)
!--------------------------------------------------------------------------------------------------
!--------------------------------------------------------------------------------------------------
! OBTAIN TEMPERATURE CORRECTION (CAPPHI,CAPPSI),THEN MULTIPLY BY OPTICAL PATH (VAR1,VAR2) TO  
! COMPUTE TEMPERATURE-CORRECTED OPTICAL PATH AND MEAN PRESSURE FOR A LAYER (PHITMP,PSITMP)
!--------------------------------------------------------------------------------------------------
    DO 1001 K=1,L
        DO 1001 I=MYIS,MYIE
                 F(I,K) =  H44194M2   * (   APCM(8)    *   X(I,K)  + BPCM (8)    * Y(I,K))
                FF(I,K) =  H44194M2   * (  ATPCM(8)    *   X(I,K)  + BTPCM(8)    * Y(I,K))
                AG(I,K) = (H1P41819   +        F(I,K)) *   F(I,K)  + ONE
               AGG(I,K) = (H1P41819   +       FF(I,K)) *  FF(I,K)  + ONE
            PHITMP(I,K) =  VAR1(I,K)  * ((((  AG(I,K)  *  AG(I,K)) ** 2) ** 2) ** 2)
            PSITMP(I,K) =  VAR2(I,K)  * (((( AGG(I,K)  * AGG(I,K)) ** 2) ** 2) ** 2)
    1001 END DO
!--------------------------------------------------------------------------------------------------
! OBTAIN OPTICAL PATH,MEAN PRESSURE FROM THE TOP TO THE PRESSURE
! P(K) (TOPM,TOPPHI)
!--------------------------------------------------------------------------------------------------
    DO 1015 I=MYIS,MYIE
          TOPM(I,1) = PHITMP(I,1)
        TOPPHI(I,1) = PSITMP(I,1)
    1015 END DO
    DO 1019 K=2,L
        DO 1017 I=MYIS,MYIE
            TOPM  (I,K) = TOPM  (I,K-1) + PHITMP(I,K)
            TOPPHI(I,K) = TOPPHI(I,K-1) + PSITMP(I,K)
        1017 END DO
    1019 END DO
!--------------------------------------------------------------------------------------------------
! TT IS THE CLOUD-FREE CTS TRANSMISSION FUNCTION
!--------------------------------------------------------------------------------------------------
    DO 1021 K=1,L
        DO 1021 I=MYIS,MYIE
            FAC1(I,K)   =  ACOMB(8)    *   TOPM(I,K)
            FAC2(I,K)   =   FAC1(I,K)  *   TOPM(I,K)   / (BCOMB(8)  * TOPPHI(I,K))
              TT(I,K)   =    EXP(HM1EZ * ( FAC1(I,K)   /   SQRT(ONE +   FAC2(I,K))                &
    &                   + BETACM(8)    * TOTVO2(I,K+1) * SKO2D))
!
            CTMP(I,K+1) =     TT(I,K)  * CLDFAC(I,K+1,1)
    1021 END DO
!--------------------------------------------------------------------------------------------------
! EXCTS IS THE CTS COOLING RATE ACCUMULATED OVER FREQUENCY BANDS
!--------------------------------------------------------------------------------------------------
    DO 1053 K=1,L
        DO 1053 I=MYIS,MYIE
            EXCTS(I,K) = EXCTS(I,K) + SORC(I,K, 8) * (CTMP(I,K+1) - CTMP(I,K))
    1053 END DO
!--------------------------------------------------------------------------------------------------
! GXCTS IS THE EXACT CTS TOP FLUX ACCUMULATED OVER FREQUENCY BANDS
!--------------------------------------------------------------------------------------------------
    DO 1061 I=MYIS,MYIE
        GXCTS(I) = GXCTS(I)    + CLDFAC(I,LP1,1)  * (  TT(I,L)      *  SORC(I,L,8)                &  
    &            + (HAF        *   DELP(I,L)      * (  TT(I,LM1)    * (   P(I,LP1)                &  
    &            - PRESS(I,L)) +     TT(I,L)      * (   P(I,LP1)    + PRESS(I,L)                  &
    &            - TWO         *      P(I,L))))   * (SORC(I,LP1,8)  -  SORC(I,L,8)))
1061 END DO
!--------------------------------------------------------------------------------------------------
! CALCULATION FOR BAND 9 ( 560-670 CM-1; INCLUDES CO2)
!--------------------------------------------------------------------------------------------------
!--------------------------------------------------------------------------------------------------
! OBTAIN TEMPERATURE CORRECTION (CAPPHI,CAPPSI),THEN MULTIPLY BY OPTICAL PATH (VAR1,VAR2) TO
! COMPUTE TEMPERATURE-CORRECTED OPTICAL PATH AND MEAN PRESSURE FOR A LAYER (PHITMP,PSITMP)
!--------------------------------------------------------------------------------------------------
    DO 1101 K=1,L
        DO 1101 I=MYIS,MYIE
                 F(I,K) =  H44194M2   * (   APCM(9)    *   X(I,K)  + BPCM (9)    * Y(I,K))
                FF(I,K) =  H44194M2   * (  ATPCM(9)    *   X(I,K)  + BTPCM(9)    * Y(I,K))
                AG(I,K) = (H1P41819   +        F(I,K)) *   F(I,K)  + ONE
               AGG(I,K) = (H1P41819   +       FF(I,K)) *  FF(I,K)  + ONE
            PHITMP(I,K) =  VAR1(I,K)  * ((((  AG (I,K) *  AG(I,K)) ** 2) ** 2) ** 2)
            PSITMP(I,K) =  VAR2(I,K)  * (((( AGG(I,K)  * AGG(I,K)) ** 2) ** 2) ** 2)
    1101 END DO
!--------------------------------------------------------------------------------------------------
! OBTAIN OPTICAL PATH,MEAN PRESSURE FROM THE TOP TO THE PRESSURE
! P(K) (TOPM,TOPPHI)
!--------------------------------------------------------------------------------------------------
    DO 1115 I=MYIS,MYIE
          TOPM(I,1) = PHITMP(I,1)
        TOPPHI(I,1) = PSITMP(I,1)
    1115 END DO
    DO 1119 K=2,L
        DO 1117 I=MYIS,MYIE
              TOPM(I,K) =   TOPM(I,K-1) + PHITMP(I,K)
            TOPPHI(I,K) = TOPPHI(I,K-1) + PSITMP(I,K)
        1117 END DO
    1119 END DO
!--------------------------------------------------------------------------------------------------
! TT IS THE CLOUD-FREE CTS TRANSMISSION FUNCTION
!--------------------------------------------------------------------------------------------------
    DO 1121 K=1,L
        DO 1121 I=MYIS,MYIE
            FAC1(I,K)   =  ACOMB(9)    *   TOPM(I,K)
            FAC2(I,K)   =   FAC1(I,K)  *   TOPM(I,K)   / (BCOMB(9)  * TOPPHI(I,K))
              TT(I,K)   =    EXP(HM1EZ * ( FAC1(I,K)   /   SQRT(ONE +   FAC2(I,K))                &
    &                   + BETACM(9)    * TOTVO2(I,K+1) * SKO2D))    * CO2SP1(I,K+1)
!             
            CTMP(I,K+1) =     TT(I,K)  * CLDFAC(I,K+1,1)
    1121 END DO
!--------------------------------------------------------------------------------------------------
! EXCTS IS THE CTS COOLING RATE ACCUMULATED OVER FREQUENCY BANDS
!--------------------------------------------------------------------------------------------------
    DO 1153 K=1,L
        DO 1153 I=MYIS,MYIE
            EXCTS(I,K) = EXCTS(I,K) + SORC(I,K, 9) * (CTMP(I,K+1) - CTMP(I,K))
    1153 END DO
!--------------------------------------------------------------------------------------------------
! GXCTS IS THE EXACT CTS TOP FLUX ACCUMULATED OVER FREQUENCY BANDS
!--------------------------------------------------------------------------------------------------
    DO 1161 I=MYIS,MYIE
        GXCTS(I) = GXCTS(I)     + CLDFAC(I,LP1, 1) * (  TT(I,L)      *  SORC(I,L,9)               &
    &            + (HAF         *   DELP(I,L)      * (  TT(I,LM1)    * (   P(I,LP1)               &
    &            - PRESS(I,L))  +     TT(I,L)      * (   P(I,LP1)    + PRESS(I,L)                 &  
    &            - TWO          *      P(I,L))))   * (SORC(I,LP1,9)  -  SORC(I,L,9)))
1161 END DO
!--------------------------------------------------------------------------------------------------
! CALCULATION FOR BAND 10 (670-800 CM-1; INCLUDES CO2)
!--------------------------------------------------------------------------------------------------
!--------------------------------------------------------------------------------------------------
! OBTAIN TEMPERATURE CORRECTION (CAPPHI,CAPPSI),THEN MULTIPLY BY OPTICAL PATH (VAR1,VAR2) TO  
! COMPUTE TEMPERATURE-CORRECTED OPTICAL PATH AND MEAN PRESSURE FOR A LAYER (PHITMP,PSITMP)
!--------------------------------------------------------------------------------------------------
    DO 1201 K=1,L
        DO 1201 I=MYIS,MYIE
                 F(I,K) =  H44194M2   * (   APCM(10)   *   X(I,K) +  BPCM(10)    * Y(I,K))
                FF(I,K) =  H44194M2   * (  ATPCM(10)   *   X(I,K) + BTPCM(10)    * Y(I,K))
                AG(I,K) = (H1P41819   +        F(I,K)) *   F(I,K) + ONE
               AGG(I,K) = (H1P41819   +       FF(I,K)) *  FF(I,K) + ONE
            PHITMP(I,K) =  VAR1(I,K)  * ((((  AG (I,K) *  AG(I,K)) ** 2) ** 2) ** 2)
            PSITMP(I,K) =  VAR2(I,K)  * (((( AGG(I,K)  * AGG(I,K)) ** 2) ** 2) ** 2)
    1201 END DO
!--------------------------------------------------------------------------------------------------
! OBTAIN OPTICAL PATH,MEAN PRESSURE FROM THE TOP TO THE PRESSURE
! P(K) (TOPM,TOPPHI)
!--------------------------------------------------------------------------------------------------
    DO 1215 I=MYIS,MYIE
          TOPM(I,1) = PHITMP(I,1)
        TOPPHI(I,1) = PSITMP(I,1)
    1215 END DO
    DO 1219 K=2,L
        DO 1217 I=MYIS,MYIE
              TOPM(I,K) =   TOPM(I,K-1) + PHITMP(I,K)
            TOPPHI(I,K) = TOPPHI(I,K-1) + PSITMP(I,K)
        1217 END DO
    1219 END DO
!---TT IS THE CLOUD-FREE CTS TRANSMISSION FUNCTION
    DO 1221 K=1,L
        DO 1221 I=MYIS,MYIE
             FAC1(I,K) = ACOMB(10)   *   TOPM(I,K)
             FAC2(I,K) =  FAC1(I,K)  *   TOPM(I,K)  / (BCOMB(10) * TOPPHI(I,K))
               TT(I,K) =   EXP(HM1EZ *  (FAC1(I,K)  /   SQRT(ONE +   FAC2(I,K))                   &
    &                  + BETACM(10)  * TOTVO2(I,K+1) * SKO2D))   * CO2SP2(I,K+1)
!               
            CTMP(I,K+1)=TT(I,K)*CLDFAC(I,K+1,1)
    1221 END DO
!--------------------------------------------------------------------------------------------------
! EXCTS IS THE CTS COOLING RATE ACCUMULATED OVER FREQUENCY BANDS
!--------------------------------------------------------------------------------------------------
    DO 1253 K=1,L
        DO 1253 I=MYIS,MYIE
            EXCTS(I,K) = EXCTS(I,K) + SORC(I,K,10) * (CTMP(I,K+1) - CTMP(I,K))
    1253 END DO
!--------------------------------------------------------------------------------------------------
! GXCTS IS THE EXACT CTS TOP FLUX ACCUMULATED OVER FREQUENCY BANDS
!--------------------------------------------------------------------------------------------------
    DO 1261 I=MYIS,MYIE
        GXCTS(I) = GXCTS(I)    + CLDFAC(I,LP1,1) * (  TT(I,L)      *  SORC(I,L,10)                &
    &             +(HAF        *   DELP(I,L)     * (  TT(I,LM1)    * (   P(I,LP1)                 &
    &             -PRESS(I,L)) +     TT(I,L)     * (   P(I,LP1)    + PRESS(I,L)                   &
    &             -TWO         *      P(I,L))))  * (SORC(I,LP1,10) -  SORC(I,L,10)))
1261 END DO
!--------------------------------------------------------------------------------------------------
! CALCULATION FOR BAND 11 (800-900 CM-1)
!--------------------------------------------------------------------------------------------------
!--------------------------------------------------------------------------------------------------
! OBTAIN TEMPERATURE CORRECTION (CAPPHI,CAPPSI),THEN MULTIPLY BY OPTICAL PATH (VAR1,VAR2) TO  
! COMPUTE TEMPERATURE-CORRECTED OPTICAL PATH AND MEAN PRESSURE FOR A LAYER (PHITMP,PSITMP)
!--------------------------------------------------------------------------------------------------
    DO 1301 K=1,L
        DO 1301 I=MYIS,MYIE
                 F(I,K) =  H44194M2  * ( APCM(11)   *   X(I,K)  +  BPCM(11)   * Y(I,K))
                FF(I,K) =  H44194M2  * (ATPCM(11)   *   X(I,K)  + BTPCM(11)   * Y(I,K))
                AG(I,K) = (H1P41819  +      F(I,K)) *   F(I,K)  + ONE
               AGG(I,K) = (H1P41819  +     FF(I,K)) *  FF(I,K)  + ONE
            PHITMP(I,K) =  VAR1(I,K) *(((( AG(I,K)  *  AG(I,K)) ** 2) ** 2) ** 2)
            PSITMP(I,K) =  VAR2(I,K) *(((( AGG(I,K) * AGG(I,K)) ** 2) ** 2) ** 2)
    1301 END DO
!--------------------------------------------------------------------------------------------------
! OBTAIN OPTICAL PATH,MEAN PRESSURE FROM THE TOP TO THE PRESSURE
! P(K) (TOPM,TOPPHI)
!--------------------------------------------------------------------------------------------------
    DO 1315 I=MYIS,MYIE
          TOPM(I,1) = PHITMP(I,1)
        TOPPHI(I,1) = PSITMP(I,1)
    1315 END DO
    DO 1319 K=2,L
        DO 1317 I=MYIS,MYIE
              TOPM(I,K) =  TOPM(I,K-1) + PHITMP(I,K)
            TOPPHI(I,K) =TOPPHI(I,K-1) + PSITMP(I,K)
        1317 END DO
    1319 END DO
!--------------------------------------------------------------------------------------------------
! TT IS THE CLOUD-FREE CTS TRANSMISSION FUNCTION
!--------------------------------------------------------------------------------------------------
    DO 1321 K=1,L
        DO 1321 I=MYIS,MYIE
            FAC1(I,K) =  ACOMB(11)    *   TOPM(I,K)
            FAC2(I,K) =   FAC1(I,K)   *   TOPM(I,K)   / (BCOMB(11) * TOPPHI(I,K))
              TT(I,K) =    EXP(HM1EZ  * ( FAC1(I,K)   /   SQRT(ONE +   FAC2(I,K))                 &
    &                 + BETACM(11)    * TOTVO2(I,K+1) * SKO2D))
!               
            CTMP(I,K+1) =   TT(I,K)   * CLDFAC(I,K+1,1)
    1321 END DO
!--------------------------------------------------------------------------------------------------
! EXCTS IS THE CTS COOLING RATE ACCUMULATED OVER FREQUENCY BANDS
!--------------------------------------------------------------------------------------------------
    DO 1353 K=1,L
        DO 1353 I=MYIS,MYIE
            EXCTS(I,K) = EXCTS(I,K) + SORC(I,K,11) * (CTMP(I,K+1) - CTMP(I,K))
    1353 END DO
!--------------------------------------------------------------------------------------------------
! GXCTS IS THE EXACT CTS TOP FLUX ACCUMULATED OVER FREQUENCY BANDS
!--------------------------------------------------------------------------------------------------
    DO 1361 I=MYIS,MYIE
        GXCTS(I) = GXCTS(I)    + CLDFAC(I,LP1,1) * (  TT(I,L)      *  SORC(I,L,11)                &
    &            + (HAF        *   DELP(I,L)     * (  TT(I,LM1)    * (   P(I,LP1)                 &
    &            - PRESS(I,L)) +     TT(I,L)     * (   P(I,LP1)    + PRESS(I,L)                   &
    &            - TWO         *      P(I,L))))  * (SORC(I,LP1,11) -  SORC(I,L,11)))
1361 END DO
!--------------------------------------------------------------------------------------------------
! CALCULATION FOR BAND 12 (900-990 CM-1)
!--------------------------------------------------------------------------------------------------
!--------------------------------------------------------------------------------------------------
! OBTAIN TEMPERATURE CORRECTION (CAPPHI,CAPPSI),THEN MULTIPLY BY OPTICAL PATH (VAR1,VAR2) TO  
! COMPUTE TEMPERATURE-CORRECTED OPTICAL PATH AND MEAN PRESSURE FOR A LAYER (PHITMP,PSITMP)
!--------------------------------------------------------------------------------------------------
    DO 1401 K=1,L
        DO 1401 I=MYIS,MYIE
                 F(I,K) =  H44194M2  * (  APCM(12)   *   X(I,K) +  BPCM(12)    * Y(I,K))
                FF(I,K) =  H44194M2  * ( ATPCM(12)   *   X(I,K) + BTPCM(12)    * Y(I,K))
                AG(I,K) = (H1P41819  +       F(I,K)) *   F(I,K) + ONE
               AGG(I,K) = (H1P41819  +      FF(I,K)) *  FF(I,K) + ONE
            PHITMP(I,K) =  VAR1(I,K) *((((  AG(I,K)  *  AG(I,K)) ** 2) ** 2) ** 2)
            PSITMP(I,K) =  VAR2(I,K) *(((( AGG(I,K)  * AGG(I,K)) ** 2) ** 2) ** 2)
    1401 END DO
!--------------------------------------------------------------------------------------------------
! OBTAIN OPTICAL PATH,MEAN PRESSURE FROM THE TOP TO THE PRESSURE
! P(K) (TOPM,TOPPHI)
!--------------------------------------------------------------------------------------------------
    DO 1415 I=MYIS,MYIE
          TOPM(I,1) = PHITMP(I,1)
        TOPPHI(I,1) = PSITMP(I,1)
    1415 END DO
    DO 1419 K=2,L
        DO 1417 I=MYIS,MYIE
              TOPM(I,K) =   TOPM(I,K-1) + PHITMP(I,K)
            TOPPHI(I,K) = TOPPHI(I,K-1) + PSITMP(I,K)
        1417 END DO
    1419 END DO
!--------------------------------------------------------------------------------------------------
! TT IS THE CLOUD-FREE CTS TRANSMISSION FUNCTION
!--------------------------------------------------------------------------------------------------
    DO 1421 K=1,L
        DO 1421 I=MYIS,MYIE
            FAC1(I,K)   =  ACOMB(12)   *   TOPM(I,K)
            FAC2(I,K)   =   FAC1(I,K)  *   TOPM(I,K)   / (BCOMB(12) * TOPPHI(I,K))
              TT(I,K)   =    EXP(HM1EZ * ( FAC1(I,K)   /   SQRT(ONE +   FAC2(I,K))                &
    &                   + BETACM(12)   * TOTVO2(I,K+1) * SKO2D))
!               
            CTMP(I,K+1) =     TT(I,K)  * CLDFAC(I,K+1,1)
    1421 END DO
!--------------------------------------------------------------------------------------------------
!---EXCTS IS THE CTS COOLING RATE ACCUMULATED OVER FREQUENCY BANDS
!--------------------------------------------------------------------------------------------------
    DO 1453 K=1,L
        DO 1453 I=MYIS,MYIE
            EXCTS(I,K) = EXCTS(I,K) + SORC(I,K,12) * (CTMP(I,K+1) - CTMP(I,K))
    1453 END DO
!---GXCTS IS THE EXACT CTS TOP FLUX ACCUMULATED OVER FREQUENCY BANDS
    DO 1461 I=MYIS,MYIE
        GXCTS(I) = GXCTS(I)    + CLDFAC(I,LP1,1) * (  TT(I,L)      * SORC(I,L,12)                 &
    &            + (HAF        *   DELP(I,L)     * (  TT(I,LM1)    * (  P(I,LP1)                  &
    &            - PRESS(I,L)) +     TT(I,L)     * (   P(I,LP1)    + PRESS(I,L)                   &
    &            - TWO         *      P(I,L))))  * (SORC(I,LP1,12) -  SORC(I,L,12)))
1461 END DO
!--------------------------------------------------------------------------------------------------
! CALCULATION FOR BAND 13 (990-1070 CM-1; INCLUDES O3))
!--------------------------------------------------------------------------------------------------
!--------------------------------------------------------------------------------------------------
! OBTAIN TEMPERATURE CORRECTION (CAPPHI,CAPPSI),THEN MULTIPLY BY OPTICAL PATH (VAR1,VAR2) TO   
! COMPUTE TEMPERATURE-CORRECTED !   OPTICAL PATH AND MEAN PRESSURE FOR A LAYER (PHITMP,PSITMP)
!--------------------------------------------------------------------------------------------------
    DO 1501 K=1,L
        DO 1501 I=MYIS,MYIE
                 F(I,K) =  H44194M2  *(   APCM(13)   *   X(I,K)  + BPCM(13)    * Y(I,K))
                FF(I,K) =  H44194M2  *(  ATPCM(13)   *   X(I,K)  + BTPCM(13)   * Y(I,K))
                AG(I,K) = (H1P41819  +       F(I,K)) *   F(I,K)  + ONE
               AGG(I,K) = (H1P41819  +      FF(I,K)) *  FF(I,K)  + ONE
            PHITMP(I,K) =  VAR1(I,K) * (((( AG(I,K)  *  AG(I,K)) ** 2) ** 2) ** 2)
            PSITMP(I,K) =  VAR2(I,K) * (((( AGG(I,K) * AGG(I,K)) ** 2) ** 2) ** 2)
    1501 END DO
!--------------------------------------------------------------------------------------------------
! OBTAIN OPTICAL PATH,MEAN PRESSURE FROM THE TOP TO THE PRESSURE
! P(K) (TOPM,TOPPHI)
!--------------------------------------------------------------------------------------------------
    DO 1515 I=MYIS,MYIE
          TOPM(I,1) = PHITMP(I,1)
        TOPPHI(I,1) = PSITMP(I,1)
    1515 END DO
    DO 1519 K=2,L
        DO 1517 I=MYIS,MYIE
              TOPM(I,K) =   TOPM(I,K-1) + PHITMP(I,K)
            TOPPHI(I,K) = TOPPHI(I,K-1) + PSITMP(I,K)
        1517 END DO
    1519 END DO
!--------------------------------------------------------------------------------------------------
!---TT IS THE CLOUD-FREE CTS TRANSMISSION FUNCTION
!--------------------------------------------------------------------------------------------------
    DO 1521 K=1,L
        DO 1521 I=MYIS,MYIE
            FAC1(I,K)   =  ACOMB(13)   *   TOPM(I,K)
            FAC2(I,K)   =   FAC1(I,K)  *   TOPM(I,K)   / (BCOMB(13) * TOPPHI(I,K))
              TT(I,K)   =    EXP(HM1EZ * ( FAC1(I,K)   /   SQRT(ONE + FAC2(I,K))                  &
    &                   + BETACM(13)   * TOTVO2(I,K+1) * SKO2D      + TO3SPC(I,K)))
!               
            CTMP(I,K+1) =     TT(I,K)  * CLDFAC(I,K+1,1)
    1521 END DO
!--------------------------------------------------------------------------------------------------
!---EXCTS IS THE CTS COOLING RATE ACCUMULATED OVER FREQUENCY BANDS
!--------------------------------------------------------------------------------------------------
    DO 1553 K=1,L
        DO 1553 I=MYIS,MYIE
            EXCTS(I,K) = EXCTS(I,K) + SORC(I,K,13) * (CTMP(I,K+1) - CTMP(I,K))
    1553 END DO
!--------------------------------------------------------------------------------------------------
!---GXCTS IS THE EXACT CTS TOP FLUX ACCUMULATED OVER FREQUENCY BANDS
!--------------------------------------------------------------------------------------------------
    DO 1561 I=MYIS,MYIE
        GXCTS(I) = GXCTS(I)    + CLDFAC(I,LP1,1) * (  TT(I,L)      *  SORC(I,L,13)                &  
    &            + (HAF        *   DELP(I,L)     * (  TT(I,LM1)    * (   P(I,LP1)                 &
    &            - PRESS(I,L)) +     TT(I,L)     * (   P(I,LP1)    + PRESS(I,L)                   &
    &            - TWO         *      P(I,L))))  * (SORC(I,LP1,13) -  SORC(I,L,13)))
1561 END DO
!--------------------------------------------------------------------------------------------------
! CALCULATION FOR BAND 14 (1070-1200 CM-1)
!--------------------------------------------------------------------------------------------------
!--------------------------------------------------------------------------------------------------
! OBTAIN TEMPERATURE CORRECTION (CAPPHI,CAPPSI),THEN MULTIPLY BY OPTICAL PATH (VAR1,VAR2) TO   
! COMPUTE TEMPERATURE-CORRECTED OPTICAL PATH AND MEAN PRESSURE FOR A LAYER (PHITMP,PSITMP)
!--------------------------------------------------------------------------------------------------
    DO 1601 K=1,L
        DO 1601 I=MYIS,MYIE
                 F(I,K) = H44194M2   * (   APCM(14)   *   X(I,K)  + BPCM(14)    * Y(I,K))
                FF(I,K) = H44194M2   * (  ATPCM(14)   *   X(I,K)  + BTPCM(14)   * Y(I,K))
                AG(I,K) = (H1P41819  +        F(I,K)) *   F(I,K)  + ONE
               AGG(I,K) = (H1P41819  +       FF(I,K)) *  FF(I,K)  + ONE
            PHITMP(I,K) =  VAR1(I,K) * ((((  AG(I,K)  *  AG(I,K)) ** 2) ** 2) ** 2)
            PSITMP(I,K) =  VAR2(I,K) * (((( AGG(I,K)  * AGG(I,K)) ** 2) ** 2) ** 2)
    1601 END DO
!--------------------------------------------------------------------------------------------------
! OBTAIN OPTICAL PATH,MEAN PRESSURE FROM THE TOP TO THE PRESSURE
! P(K) (TOPM,TOPPHI)
!--------------------------------------------------------------------------------------------------
    DO 1615 I=MYIS,MYIE
          TOPM(I,1) = PHITMP(I,1)
        TOPPHI(I,1) = PSITMP(I,1)
    1615 END DO
    DO 1619 K=2,L
        DO 1617 I=MYIS,MYIE
              TOPM(I,K) =  TOPM(I,K-1) + PHITMP(I,K)
            TOPPHI(I,K) =TOPPHI(I,K-1) + PSITMP(I,K)
        1617 END DO
    1619 END DO
!--------------------------------------------------------------------------------------------------
! TT IS THE CLOUD-FREE CTS TRANSMISSION FUNCTION
!--------------------------------------------------------------------------------------------------
    DO 1621 K=1,L
        DO 1621 I=MYIS,MYIE
            FAC1(I,K)   =  ACOMB(14)   *   TOPM(I,K)
            FAC2(I,K)   =   FAC1(I,K)  *   TOPM(I,K)   / (BCOMB(14) * TOPPHI(I,K))
              TT(I,K)   =    EXP(HM1EZ * ( FAC1(I,K)   /   SQRT(ONE +   FAC2(I,K))                &
    &                   + BETACM(14)   * TOTVO2(I,K+1) * SKO2D))
!               
            CTMP(I,K+1) =     TT(I,K)  * CLDFAC(I,K+1,1)
    1621 END DO
!--------------------------------------------------------------------------------------------------
! EXCTS IS THE CTS COOLING RATE ACCUMULATED OVER FREQUENCY BANDS
!--------------------------------------------------------------------------------------------------
    DO 1653 K=1,L
        DO 1653 I=MYIS,MYIE
            EXCTS(I,K) = EXCTS(I,K) + SORC(I,K,14) * (CTMP(I,K+1) - CTMP(I,K))
    1653 END DO
!--------------------------------------------------------------------------------------------------
! GXCTS IS THE EXACT CTS TOP FLUX ACCUMULATED OVER FREQUENCY BANDS
!--------------------------------------------------------------------------------------------------
    DO 1661 I=MYIS,MYIE
        GXCTS(I) = GXCTS(I)    + CLDFAC(I,LP1,1) * (  TT(I,L)      *  SORC(I,L,14)                &
    &            + (HAF        *   DELP(I,L)     * (  TT(I,LM1)    * (   P(I,LP1)                 &
    &            - PRESS(I,L)) +     TT(I,L)     * (   P(I,LP1)    + PRESS(I,L)                   &
    &            - TWO         *      P(I,L))))  * (SORC(I,LP1,14) -  SORC(I,L,14)))
1661 END DO
!--------------------------------------------------------------------------------------------------
! OBTAIN CTS FLUX AT THE TOP BY INTEGRATION OF HEATING RATES AND USING CTS FLUX AT THE BOTTOM   
! (CURRENT VALUE OF GXCTS). NOTE THAT THE PRESSURE QUANTITIES AND CONVERSION FACTORS HAVE NOT
! BEEN INCLUDED EITHER IN EXCTS OR IN GXCTS. THESE CANCEL OUT, THUS REDUCING COMPUTATIONS
!--------------------------------------------------------------------------------------------------
    DO 1731 K=1,L
        DO 1731 I=MYIS,MYIE
            GXCTS(I) = GXCTS(I) - EXCTS(I,K)
1731 END DO
!--------------------------------------------------------------------------------------------------
! NOW SCALE THE COOLING RATE (EXCTS) BY INCLUDING THE PRESSURE FACTOR (DELP) AND THE CONVERSION  
! FACTOR (RADCON)
!--------------------------------------------------------------------------------------------------
    DO 1741 K=1,L
        DO 1741 I=MYIS,MYIE
            EXCTS(I,K) = EXCTS(I,K) * RADCON * DELP(I,K)
    1741 END DO
!--------------------------------------------------------------------------------------------------
! THIS IS THE END OF THE EXACT CTS COMPUTATIONS; AT THIS POINT EXCTS HAS ITS APPROPRIATE VALUE.
!--------------------------------------------------------------------------------------------------
!--------------------------------------------------------------------------------------------------
! COMPUTE APPROXIMATE CTS HEATING RATES FOR 15UM AND 9.6 UM BANDS (CTSO3)
!--------------------------------------------------------------------------------------------------
    DO 1711 K=1,L
        DO 1711 I=MYIS,MYIE
            CTMP2(I,K+1) = CO2SP(I,K+1) * CLDFAC(I,K+1,1)
            CTMP3(I,K+1) = TO3SP(I,K)   * CLDFAC(I,K+1,1)
    1711 END DO
    DO 1701 K=1,L
        DO 1701 I=MYIS,MYIE
           CTSO3(I,K) = RADCON       *   DELP(I,K)   * (CSOUR(I,K) * (CTMP2(I,K+1) - CTMP2(I,K))  &
    &                 + SORC(I,K,13) * (CTMP3(I,K+1) -  CTMP3(I,K)))
    1701 END DO
!
    RETURN
    END SUBROUTINE SPA88

However,  my equivalent variables are constant changing its values,

My question is, everytime any of this variables changes its value along the code i must do again the transfer function ?

Exist another easier way to do it ?

 

Thank you very much for your attention

Thread Topic: 

Question

error #7068: The characteristics of a dummy argument

$
0
0

I have a CFS code which was developed at NCEP. Code was able to compile with intel 13, when I was trying to compile the same code with Intel 17.0, I am getting error #7068: The characteristics of a dummy argument  (https://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux... ).  Is there any FLAG/OPTION in intel 17.0 to over come this problem. Because CFS code is complicated and it will take much time to revise.

Zone: 

Thread Topic: 

Question

Compiler bug in version 17

$
0
0

I think there may be an obscure bug in Intel Fortran Version 17 which breaks our electronic structure code (http://elk.sourceforge.net/).

It's a bit tricky to reproduce but I've simplified it as far as I can.

You need the following module file (modtest.f90):

module modtest

integer m,n
integer k(2)
real(8), allocatable :: ev(:,:)

end module

and the following program (test.f90):

program test
use modtest
implicit none

integer i,j
real(8) ef,e0,e1,e

m=10
n=8

allocate(ev(m,n))
call random_number(ev(:,:))

ef=0.5d0

e0=-1.d8
e1=1.d8

do j=1,n
  do i=1,m
    e=ev(i,j)
    if (e.lt.ef) then
      if (e.gt.e0) then
        e0=e
        k(1)=j
      end if
    else
      if (e.lt.e1) then
        e1=e
        k(2)=j
      end if
    end if
  end do
end do

print *,e0,e1

end program

 

The the module and the program have to be in separate files.

 

If I compile with version ifort 17 as follows:

ifort -O2 modtest.f90 test.f90

... the code produces:

-100000000.000000        100000000.000000

 

If I compile with version 16, I get correctly:

  0.494784114443067       0.523222485777880

 

The code works fine if the variables in modtest are transferred to the program; or if the module and program are combined into a single file. It works if you insert a print statement in the inner loop. If the array k(2) is changed to two variables, say k1, k2, then the code also works.

The bug seems to be related to optimization: using -O0 or -O1 produces the correct output.

 

Additional info:

>uname -or
3.10.0-514.21.1.el7.x86_64 GNU/Linux>lsb_release -irc
Distributor ID:	CentOS
Release:	7.3.1611
Codename:	Core>ifort --version
ifort (IFORT) 17.0.0 20160721
Copyright (C) 1985-2016 Intel Corporation.  All rights reserved.

 

I hope you can reproduce it.

 

Regards,

John.

 

Zone: 

Thread Topic: 

Bug Report

undefined reference to `_intel_fast_memmove'

$
0
0

I have installed the fortran_studio_xe_2013_update4_intel64 and Roguewave_IMSL library. after installing it I ran the setup files before compiling the fortran code.

source /opt/intel/bin/compilervars.sh intel64
. /opt/intel/imsl/install/imsl/fnl710/lnxin140x64/bin/fnlsetup.sh

In make file i have used ifort for creating objects and linking and i have included the shared library (LINK_FNL)  while linking.

while compiling the fortran code its throwing the error 

/opt/intel/imsl/install/imsl/fnl710/lnxin140x64/lib/libimsl.so: undefined reference to `_intel_fast_memmove'

 

Can you please assist on this.

 

Regards,

Deva. 

Zone: 

Thread Topic: 

Help Me

-coarray=shared on KNL, hangs if num_images>=16

$
0
0

Hi,

I have a coarray program which runs fine on a small 4-core desktop, also runs oversubscribed well beyond the number of cores; this is using parallel_studio_xe_2017.0.035. 

On a KNL single node (64 core) using the cluster edition on the same ifort above, it runs perfectly with up to 15 images, but it hangs forever at 16 or more images without running any code.  I'm compiling with -coarray=shared and also setting the number of images with, say, -coarray-num-images=16 for 16 images.  I'm unable to figure out what configuration detail is missing to hang at 16 or more images.  Any insight would be appreciated!

Many thanks, Ted

Thread Topic: 

Question

Error when Optimization used in code

$
0
0

Hi,

I have a code which uses the PETSc library. When optimization is turned off, the code runs fine. However, when I turn on optimization, I got:

[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range

...

After some search, I found that if I only use -O1 in one of the source code (others still using -ip -O3 -ipo), the code runs fine.

The error seems to happen after calling a PETSc subroutine. However, this subroutine was also called in other source codes but it runs fine with optimization.

So is this a bug with the optimization routine? Or is there some error in the PETsc subroutine?

Please advise. Thanks!

 

Play with Fortran in the cloud

$
0
0

Hi all,

I have created a Jupyter Notebook kernel for Fortran. Currently, this uses GFortran 7.1 and OpenCoarrays but it would not be hard to extend/fork it to run with ifort. The repo with the magic sauce is over at https://github.com/sourceryinstitute/jupyter-CAF-notebook. This repository includes the Docker files to install all the prerequisites including GFortran 7.1 and OpenCoarrays, as well as the Jupyter kernel for compiling/running Fortran cells. You can try it out online thanks to the Binder project: https://beta.mybinder.org/v2/gh/sourceryinstitute/jupyter-CAF-kernel/master For the brief demo, you can click the index.ipynb file to run that notebook. You can also use this link to open that notebook directly, which will allow you to run it and make modifications, but it is read-only so you won't be able to save those modifications: https://beta.mybinder.org/v2/gh/sourceryinstitute/jupyter-CAF-kernel/master

Also, please note that this is a demo/teaching/toy (on Binder that is) so you won't be able to run anything even remotely close to a full scale job. The kernel itself does not impose this restriction, in theory you could install it on your own cluster and dispatch jobs to nodes, but I haven't learned how to implement that quite yet. Anyway, comments, suggestions, and contributed tutorial/example notebooks are always welcome. If anyone wants advice/help setting something like this up with Intel ifort as the back end, I'd be happy to try to help out.


Partially assumed-shape arrays

$
0
0

When I compile the following snippet:

      program dimension_specifications_incompatible
            implicit none
            integer,dimension(1:3,1:3)::a
            call print_matrix(a)
  end program dimension_specifications_incompatible

      subroutine print_matrix(b)
            implicit none
            integer,dimension(1:3,1: )::b
            print *,b
  end subroutine print_matrix!b

I get the following compiler error:

error #6644: The dimension specifications are incompatible.   [B]
            integer,dimension(1:3,1: )::b
----------------------------------------^

Aren't partially assumed-shape arrays allowed in fortran? since fully defined shapes,and fully assumed ones are allowed, and checked, I cannot understand the problem with a partially assumed one.

Thread Topic: 

Question

Error in multigrid code

$
0
0

Hi,

I am writing a Multigrid code and I have encountered a strange bug. Sorry this might be a little bit long, but I am seeking for help desperately. The structure of my code is as follows.

 

1. I need some information (Matrices, Mesh information etc.) to start the code. I can generate all the information using Matlab. Then I write those data in txt files. After that, I wrote a simple subroutine in fortran to read all these data. Say I have 5-6 variables containing all the information I need to start the computation.

 

2. Since I already have this code in Matlab, all I need to do is to translate those codes into fortran codes ( The reason I did this is that I wanna compute some 3D numerical experiments which Matlab on laptop cannot handle). So the other parts of the codes are the same as matlab codes.

 

3. The algorithm itself requires me to have a deferred size array. Because I need to keep track of the solution which transfer through different grids. That means the size of these arrays are changing all the time. The following is a part of my codes which does this job.

 

         ms=size(X(kk)%component)/3
         allocate(yy(ms))
         yy=0
         yy(Free(kk)%component)=uc             ! the size of yy is larger than uc
         deallocate(uc)

         allocate(ff(size(X(kk+1)%component)/3))   ! size of ff is larger than yy
         ff=0
         ff=smvpro(pro(kk)%component,yy)    ! this line change the size of yy
         uu=uu+ff(Free(kk+1)%component)
         deallocate(ff,yy)

 

 

So basically I allocate and deallocate a lot to achieve my goal. 

 

4. I've ran the codes. The results are confusing. If the discretization of mesh become finer and finer, the results should be better and better. At first 7 levels the results are good and basically the same as the results of Matlab. But when I reach level 8, the results suddenly blew up. But the results of Matlab are still good.

 

5. My questions are, if I assume the algorithm is correct (Matlab gave the correct results), what could be the problem when I have a very fine mesh in fortran?

 

6. My guesses are: 

 

Could the way of reading data be wrong? Because I export the data from Matlab and read the data in fortran. I checked this everything looks fine. 

 

Could the way I allocate and deallocate the arrays cause a problem?

 

Could the way I pass arrays through subroutine be wrong? (It is a recursive code so I have a recursive subroutine)

 

Thank you.

 

Thread Topic: 

Help Me

mac fort openmp

$
0
0

The man for openmp has no description text, so has it been dropped or not working ?

ifort -qopenmp should work, or has the default operation changed ?

[mac27:~/test] bmcinnes% ifort -V

Intel(R) Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 17.0.4.181 Build 20170411
Copyright (C) 1985-2017 Intel Corporation.  All rights reserved.

[mac27:~/test] bmcinnes% ifort -qopenmp hello.f
[mac27:~/test] bmcinnes% ./a.out
dyld: Library not loaded: @rpath/libiomp5.dylib
  Referenced from: /Volumes/User/bmcinnes/test/./a.out
  Reason: image not found
Abort
[mac27:~/test] bmcinnes% otool -L a.out
a.out:
    @rpath/libiomp5.dylib (compatibility version 5.0.0, current version 5.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.60.2)
[mac27:~/test] bmcinnes% ifort -qopenmp-link=dynamic hello.f
[mac27:~/test] bmcinnes% ./a.out
 Hello
[mac27:~/test] bmcinnes% cat hello.f
      print *, "Hello"
      end
[mac27:~/test] bmcinnes% !ot
otool -L a.out
a.out:
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.60.2)
[mac27:~/test] bmcinnes%

Thread Topic: 

Question

Is it possible to compile with intel fortran and openmpi instead of intelmpi?

$
0
0

Hello, everyone

I currently working with an open source software, when compiled with gfortran and openmpi, it works. However, when compiled with intel parallel studio, it got mysterious mpiabort failure.

I think gfortran is not as fast as intel fortran, so I would like to know if there is a way to compile source with intel fortran compiler and openmpi instead of intelmpi.

But as far as I know, if I add 

. /opt/intel/parallel_studio_xe_2017.4.056/psxevars.sh intel64

to the bashrc, the mpi automatically becomes intel mpi.

I tried to disable intelmpi by renaming mpivars.sh, but then I lost mpiifort.

By the way, I am using ubuntu desktop with 8 core cpu.

 

Thread Topic: 

How-To

Calling non-deferred procedure in abstract type by parent name

$
0
0
So I have an abstract type with some stuff in it, and a procedure to set that stuff
module firstTypeMod
type, abstract:: firstType
    character(len=30):: tempChar
contains
  procedure(defProc), deferred:: deferredProcedure
  procedure:: setChar
end type

abstract interface
  subroutine defProc(self)
     import firstType
    class(firstType), intent(inout):: self
  end subroutine defProc
end interface

contains
 subroutine setChar(self, charIn)
   class(firstType), intent(inout):: self
  character(len=*):: charIn

  self%tempChar = charIn
 end subroutine setChar
end module firstTypeMod

I now want to define another type which extends this

module secondTypeMod
 use firstTypeMod

type, extends(firstType):: secondType
   character(len=100):: tempChar2
  contains
  procedure:: deferredProcedure => secondDef
  procedure:: setChar => overRideSetChar
end type

contains
subroutine secondDef(self)
class(secondType), intent(inout):: self

write(*,*) "OVERRIDDEN"
end subroutine secondDef

subroutine overRideSetChar(self, charIn)
 class(secondType), intent(inout):: self
 character(len=*), intent(in):: charIn

 call self%firstType%setChar(charIn)

 self%tempChar2 = charIn
end subroutine overRideSetChar

end module secondTypeMod 
However, when I try this I get the following error:
error #8314: If the rightmost part-name is of abstract type, data-ref shall be polymorphic.

 

Is it possible to do what I want directly?   I know that I can make an intermediate class that isn't abstract that will allow me to do this, but I would really prefer to avoid that.   Is it possible to call the parent of an overridden non-deferred subroutine of an abstract type?

Thank you.

Edit: A slightly modified version (to remove some typos) is attached to this post which illustrates the error.

AttachmentSize
Downloadapplication/octet-streamfirstType.f901.21 KB

Thread Topic: 

Question
Viewing all 2746 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>