Parallel bug in set_data.F for point winds.

Bug reports, work arounds and fixes

Moderators: arango, robertson

Post Reply
Message
Author
User avatar
hetland
Posts: 81
Joined: Thu Jul 03, 2003 3:39 pm
Location: TAMU,USA

Parallel bug in set_data.F for point winds.

#1 Unread post by hetland »

There is a parallel bug in roms-2.2 (and beyond, I think) which does not correctly read in point winds for parallel cases. Here is the fix to Nonlinear/set_data.F:

Code: Select all

!
!  If input point surface winds, rotate to curvilinear grid.
!
      IF (.not.Linfo(1,idUair,ng)) THEN
        DO j=MIN(Jstr-1,JstrR),JendR                  !!! changed
          DO i=MIN(Istr-1,IstrR),IendR                !!! changed
            cff1=FORCES(ng)%Uwind(i,j)*                                 &
     &           COS(GRID(ng)%angler(i,j))+                             &
     &           FORCES(ng)%Vwind(i,j)*                                 &
     &           SIN(GRID(ng)%angler(i,j))
            cff2=FORCES(ng)%Vwind(i,j)*                                 &
     &           COS(GRID(ng)%angler(i,j))-                             &
     &           FORCES(ng)%Uwind(i,j)*                                 &
     &           SIN(GRID(ng)%angler(i,j))
            FORCES(ng)%Uwind(i,j)=cff1
            FORCES(ng)%Vwind(i,j)=cff2
          END DO
        END DO
      END IF
i.e., add the MIN(Jstr-1,JstrR) to lines 235, MIN(Istr-1,IstrR) and 236.

User avatar
arango
Site Admin
Posts: 1367
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

#2 Unread post by arango »

Yes, it needs a MPI exchange for distributed-memory applications. Good catch :!: Your fix, however, introduces a shared-memory bug.

Code: Select all

      IF (.not.Linfo(1,idUair,ng).or.                                   &
     &    (Iinfo(5,idUair,ng).ne.Lm(ng)+2).or.                          &
     &    (Iinfo(6,idUair,ng).ne.Mm(ng)+2)) THEN
        DO j=JstrR,JendR
          DO i=IstrR,IendR
            cff1=FORCES(ng)%Uwind(i,j)*                                 &
     &           COS(GRID(ng)%angler(i,j))+                             &
     &           FORCES(ng)%Vwind(i,j)*                                 &
     &           SIN(GRID(ng)%angler(i,j))
            cff2=FORCES(ng)%Vwind(i,j)*                                 &
     &           COS(GRID(ng)%angler(i,j))-                             &
     &           FORCES(ng)%Uwind(i,j)*                                 &
     &           SIN(GRID(ng)%angler(i,j))
            FORCES(ng)%Uwind(i,j)=cff1
            FORCES(ng)%Vwind(i,j)=cff2
          END DO
        END DO
#     if defined EW_PERIODIC || defined NS_PERIODIC
        CALL exchange_r2d_tile (ng, Istr, Iend, Jstr, Jend,             &
     &                          LBi, UBi, LBj, UBj,                     &
     &                          FORCES(ng)%UWind)
        CALL exchange_r2d_tile (ng, Istr, Iend, Jstr, Jend,             &
     &                          LBi, UBi, LBj, UBj,                     &
     &                          FORCES(ng)%UWind)
#     endif
#     ifdef DISTRIBUTE
        CALL mp_exchange2d (ng, iNLM, 2, Istr, Iend, Jstr, Jend,        &
     &                      LBi, UBi, LBj, UBj,                         &
     &                      NghostPoints, EWperiodic, NSperiodic,       &
     &                      FORCES(ng)%UWind,                           &
     &                      FORCES(ng)%VWind)
#     endif
      END IF 
This fix requires local declarations for EWperiodic and NSperiodic. Also we need to include some modules with the USE command.

As a matter of fact, similar exchanges are needed for point surface momentum stress and wave data.

I made several changes to this routine and put it in the corrections tar for version 2.2. Thank you for finding and reporting this bug.

kh_hyun

Unable to access mp_exchange_mod

#3 Unread post by kh_hyun »

Hi,
I got a compile error (as below) related with set_data.F and exchange_mod. Please let me know if you have any ideas. Thank you.
Hoon

% gmake
/u2/wes/hyun/bin/cpp -P -DAIX -I/usr/local/pkg/netcdf/netcdf-3.5.0_64/include -DMPI -DAIX -D00203FCA4C00 -DXLF -IInclude -INonlinear -IDrivers -ISeaIce Nonlinear/set_data.F > set_data.f90
Bin/cpp_clean set_data.f90
mpxlf95_r -c -qsuffix=f=f90 -qmaxmem=-1 -qarch=pwr4 -qtune=pwr4 -q64 -O3 -qstrict set_data.f90
** set_data === End of Compilation 1 ===
"set_data.f90", line 92.11: 1514-219 (S) Unable to access module symbol file for module mp_exchange_mod. Check path and file permissions of file. Use association not done for this module.
1501-511 Compilation failed for file set_data.f90.
gmake: *** [set_data.o] Error 1

User avatar
arango
Site Admin
Posts: 1367
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

#4 Unread post by arango »

Oops, yes. I uploaded the wrong file. The module mp_exchange is part of ROMS version 3.0. Please get the corrections tar file again.

http://www.myroms.org/links/corrections-2-2.tar.gz

Thank you for reporting this problem :!:

Post Reply