diff --git a/code/mesh.f90 b/code/mesh.f90 index 045f43613..7358ea9eb 100644 --- a/code/mesh.f90 +++ b/code/mesh.f90 @@ -3608,17 +3608,18 @@ use IO, only: & implicit none integer(pInt), intent(in) :: myUnit +#ifndef Spectral integer(pInt), parameter :: maxNchunks = 5_pInt integer(pInt), dimension (1+2*maxNchunks) :: myPos integer(pInt) chunk, Nchunks character(len=300) :: line, damaskOption, v -#ifndef Spectral character(len=300) :: keyword #endif + +#ifdef Spectral + mesh_periodicSurface = .true. +#else mesh_periodicSurface = .false. - -610 FORMAT(A300) - #ifdef Marc keyword = '$damask' #endif @@ -3631,33 +3632,22 @@ use IO, only: & read (myUnit,610,END=620) line myPos = IO_stringPos(line,maxNchunks) Nchunks = myPos(1) -#ifndef Spectral - if (IO_lc(IO_stringValue(line,myPos,1_pInt)) == keyword .and. Nchunks > 1_pInt) then ! found keyword for damask option and there is at least one more chunk to read + if (IO_lc(IO_stringValue(line,myPos,1_pInt)) == keyword .and. Nchunks > 1_pInt) then ! found keyword for damask option and there is at least one more chunk to read damaskOption = IO_lc(IO_stringValue(line,myPos,2_pInt)) select case(damaskOption) - case('periodic') ! damask Option that allows to specify periodic fluxes - do chunk = 3_pInt,Nchunks ! loop through chunks (skipping the keyword) - v = IO_lc(IO_stringValue(line,myPos,chunk)) ! chunk matches keyvalues x,y, or z? + case('periodic') ! damask Option that allows to specify periodic fluxes + do chunk = 3_pInt,Nchunks ! loop through chunks (skipping the keyword) + v = IO_lc(IO_stringValue(line,myPos,chunk)) ! chunk matches keyvalues x,y, or z? mesh_periodicSurface(1) = mesh_periodicSurface(1) .or. v == 'x' mesh_periodicSurface(2) = mesh_periodicSurface(2) .or. v == 'y' mesh_periodicSurface(3) = mesh_periodicSurface(3) .or. v == 'z' enddo endselect endif -#else - damaskOption = IO_lc(IO_stringValue(line,myPos,1_pInt)) - select case(damaskOption) - case('periodic') ! damask Option that allows to specify periodic fluxes - do chunk = 2_pInt,Nchunks ! loop through chunks (skipping the keyword) - v = IO_lc(IO_stringValue(line,myPos,chunk)) ! chunk matches keyvalues x,y, or z? - mesh_periodicSurface(1) = mesh_periodicSurface(1) .or. v == 'x' - mesh_periodicSurface(2) = mesh_periodicSurface(2) .or. v == 'y' - mesh_periodicSurface(3) = mesh_periodicSurface(3) .or. v == 'z' - enddo - endselect -#endif enddo +#endif +610 FORMAT(A300) 620 end subroutine mesh_get_damaskOptions