# 1 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"

# 28 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"

# 1 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/Avance.incl" 1
;Avance4.incl
;   for AV 4
;
;avance-version (16/08/18)
;
;$CLASS=HighRes Incl
;$COMMENT=


# 19 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/Avance.incl"
;setrtp0 denotes TimingController


# 50 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/Avance.incl"
# 51 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/Avance.incl"


# 63 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/Avance.incl"
# 89 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/Avance.incl"
# 90 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/Avance.incl"


# 123 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/Avance.incl"
;#define LOWQ
;#define HIGHQ


;#define MIX_UP
;#define MIX_DOWN
# 136 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/Avance.incl"
;$Id: Avance4.incl,v 1.11 2016/11/11 13:43:39 ber Exp $
# 30 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp" 2

# 1 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/Grad.incl" 1
;Grad4.incl  -  include file for Gradient Spectroscopy
;   for AV 4
;
;avance-version (16/05/23)
;
;$CLASS=HighRes Incl
;$COMMENT=

# 26 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/Grad.incl"
define list<gradient> EA=<EA>


# 30 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/Grad.incl"
;$Id: Grad4.incl,v 1.6 2016/11/11 13:43:39 ber Exp $
# 31 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp" 2

# 1 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/Delay.incl" 1
;Delay.incl  -  include file for commonly used delays
;
;version (13/08/07)
;
;$CLASS=HighRes Incl
;$COMMENT=

# 9 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/Delay.incl"
;general delays

define delay DELTA
define delay DELTA1
define delay DELTA2
define delay DELTA3
define delay DELTA4
define delay DELTA5
define delay DELTA6
define delay DELTA7
define delay DELTA8
define delay DELTA9
define delay DELTA10
define delay DELTA11
define delay DELTA12
define delay DELTA13
define delay DELTA14
define delay DELTA15
define delay DELTA16

define delay TAU
define delay TAU1
define delay TAU2
define delay TAU3
define delay TAU4
define delay TAU5
define delay TAU6
define delay TAU7
define delay TAU8
define delay TAU9
# 40 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/Delay.incl"
define delay INCR1
define delay INCR2
define delay INCR3
define delay INCR4
define delay INCR5
define delay INCR6


;delays for centering pulses
# 50 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/Delay.incl"
define delay CEN_HN1
define delay CEN_HN2
define delay CEN_HN3
define delay CEN_HC1
define delay CEN_HC2
define delay CEN_HC3
define delay CEN_HC4
define delay CEN_HP1
define delay CEN_HP2
define delay CEN_CN1
define delay CEN_CN2
define delay CEN_CN3
define delay CEN_CN4
define delay CEN_CP1
define delay CEN_CP2


;loop counters
# 69 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/Delay.incl"
define loopcounter COUNTER
define loopcounter SCALEF
define loopcounter FACTOR1
define loopcounter FACTOR2
define loopcounter FACTOR3
define loopcounter FACTOR4
define loopcounter FACTOR5
define loopcounter FACTOR6


# 80 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/Delay.incl"
;$Id: Delay.incl,v 1.15 2013/08/30 09:42:06 ber Exp $
# 32 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp" 2

;Define phases

# 39 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
;Define Pulses
define pulse pwh
       "pwh=p1"
define pulse pwmlev
       "pwmlev=p12"
define pulse pwcreb
       "pwcreb=p25"
define pulse pwn
       "pwn=p3"
define pulse pwc
       "pwc=p2"
define pulse pwcdip
       "pwcdip=p22"

;#ifdef -DCbdec
;define pulse pwcbdec  ; wurst for selective Cb dec
;       "pwcbdec=p27"
;#endif

define pulse pwd
       "pwd=p4"
define pulse pwddec
       "pwddec=p41"
# 63 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
;Define delays
"d11=30m"
"in0=inf1/2"
"in10=inf2/2"

define delay taua
       "taua = d20"      ; < 1/4JCH ~ 1.8 ms

define delay taub
       "taub = d21"     ; ~ 0.3/JCH * 0.5,  1.05 ms
# 74 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
define delay tauc
       "tauc = d22"       ; 2tauc is time for transfer from 13C to 15N

define delay bigTN
       "bigTN = d25"     ; < 1/4JNCO delay, N constant time period

define delay tauf
       "tauf = d26"       ; < 1/4JNH, ~ 2.2 ms
# 83 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
define delay zeta
define delay zeta1
       "zeta1=0.1u"
 
define delay bigT1
     "bigT1 = d14"  ; 650 us

define delay hscuba
      "hscuba = 30m"

;Define flags
;define f1180  ; set zgoptns -Df1180
# 98 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
 "d0=0.2u"


;define f2180  ; set zgoptns -Df2180
# 105 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
 "d10=0.2u"


"d30 = 0.2u"  ; redefined later in program
# 110 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
;"acqt0=0"
;aqseq 321     ; Determines the order of acquisition when 'mc' macro is used.

define loopcounter ncyc
   "ncyc = l7"

# 118 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
define loopcounter ni
       " ni = td1/2"
define loopcounter zetacount
       "zetacount=1"
define loopcounter ni2
       "ni2 = td2/2"


"l10 = 1"
# 132 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  "cnst12=plw12" ; tpwrml - set max at 0.8W
  "cnst22=plw22" ; dpwrdip - set max at 65W
  "cnst23=plw23" ; dpwrcodec - set max at 10.0W
  "cnst25=spw25" ; power level for reburp pulse 
  "cnst26=plw26" ; CO decoupling during 15N t2 


  "cnst27=plw27" ; dpwrcbdec - set max at 2.0W
# 142 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  "cnst31=plw31" ; dpwr2 - set max at 6W

  "cnst4=plw4" ; dpwr3 pl4 - set max at 10.5W for 2H pulses
  "cnst41=plw41" ; dpwr3dec pl41 - set max at 1.5W

# 1 "mc_line 150 file /root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp exp. def. part of mc cmd. before ze"
; dimension 3D; AQ_mode  (F2) Echo-Antiecho (F1) States
define delay MCWRK
define delay MCREST
define delay d0orig
"d0orig=d0"
define loopcounter l10orig
"l10orig=l10"
define delay d10orig
"d10orig=d10"
define loopcounter t2loop
"t2loop=0"
define loopcounter t1loop
"t1loop=0"
define loopcounter ph1loop
"ph1loop=0"
define loopcounter ph2loop
"ph2loop=0"
define loopcounter ST1CNT
"ST1CNT = trunc(td1 / 2)"
define loopcounter ST2CNT
"ST2CNT = trunc(td2 / 2)"
"MCREST = d11 - d11"
"MCWRK = 0.033333*d11"
# 150 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
# 150 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
1 ze
# 1 "mc_line 150 file /root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp exp. def. of mc cmd. after ze"
LBLAV, MCWRK
      "d0=d0orig + t1loop * in0 "
      "phval10 = (ph1loop % 2) * 90"
      MCWRK ip10 + phval10
      "l10 = l10orig + ph1loop * 1"

      "d10=d10orig + t2loop * in10 "
      "phval9 = (ph2loop % 2) * 180"
      MCWRK ip9 + phval9
      "phval7 = (t2loop * 180)%360"
      MCWRK ip7 + phval7
      "phval31 = (t2loop * 180)%360"
      MCWRK ip31 + phval31
      MCWRK
      "phval0 = ph2loop * 1"
      MCWRK setgrad EA
# 151 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"

; check validity of parameters

  if "d0 < 0.2u "
  {
   "d0=0.2u"
  }
# 159 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  if "d10 < 0.2u "
  {
   "d10=0.2u"
  }

# 172 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"

  if "p22 < 24u" 
  {
   2u
   print "error: pwcdip p22 incorrect"
   goto HaltAcqu
  }
# 180 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  if "cnst12 > 1.5"
  {
   2u
   print "error: tpwrml pl12 incorrect"
   goto HaltAcqu
  }

  if "cnst22 > 37.0"
  {
   2u
   print "error: dpwrdip pl22 incorrect"
   goto HaltAcqu
  }

  if "cnst23 > 1.0"
  {
   2u
   print "error: dpwrcodec pl23/spw23 for CO seduce dec t1  incorrect"
   goto HaltAcqu
  }
# 201 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  if "cnst25 > 140.0"
  {
   2u
   print "error: power level for reburp is too large "
   goto HaltAcqu
  }

  if "cnst26 > 1.0"
  {
   2u
   print "error: power level for 13CO decoupling during 15N t2 acq is too large"
   goto HaltAcqu
  }

# 216 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  if "cnst27 > 2.0"
  {
   2u
   print "error: dpwrcbdec pl27/spw27 for Cb wurst(90) dec incorrect"
   goto HaltAcqu
  }


  if "cnst31 > 4.0"
  {
   2u
   print "error: dpwr2 pl31 incorrect"
   goto HaltAcqu
  }
# 231 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  if "ncyc > 9"
  {
   2u
   print "error: ncyc is too large"
   goto HaltAcqu
  }

  if "pwcdip*94.22*ncyc > 30m"
  {
   2u
   print "error: dipsi time is too large"
   goto HaltAcqu
  }

# 246 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  if "cnst4 > 10.5"
  {
   2u
   print "error: dpwr3 pl4 too large"
   goto HaltAcqu
  }

  if "cnst41 > 2.0"
  {
   2u
   print "error: dpwr3dec pl41 too large"
   goto HaltAcqu
  }

  if "pwd < 100.0u"
  {
   2u
   print "error: pwd is too short > 100 us"
   goto HaltAcqu
  }
# 267 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  if "pwddec < 300.0u"
  {
   2u
   print "error: pwddec is too short > 300 us"
   goto HaltAcqu
 }

;  d11  
  50u setrtp0|0    ; turn on lock hold
  d11 h2pulse       ;SEL_2H plus interleave_incr    ; put lock to pulse mode
  2u pl41:f4

# 1 "mc_line 280 file /root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp exp. start label for mc cmd."
2 MCWRK  * 7 do:f3
LBLF2, MCWRK  * 7
LBLST2, MCWRK  * 8
LBLF1, MCWRK  * 7
LBLST1, MCWRK 
  MCREST
# 281 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
# 283 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
d11 h2lock         ;SEL_2H plus interleave_incr    ; put lock channel in lock mode
6m setrtp0^0   ; turn off lock hold

# 301 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
 2u pl1:f1                        ; power(tpwr)
 d1                               ; delay(d1)

# 305 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
50u  setrtp0|0
15u h2pulse       ;SEL_2H plus interleave_incr

# 330 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"

  2u pl3:f3
  2u fq=0:f2                             ;13C SFO2 @ 43ppm
  2u pl2:f2                              ;power for C90
  2u pl1:f1   
# 336 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
; ensure magnetization originates on 1H not on C or N
  (pwc ph=0.0):f2  
  2u
  (pwn ph=0.0):f3  


  20u ctrlgrad 0 ; this unblanks the gradients, lock is already in hold mode from above
# 347 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  2u
  (p50:gp0)                      
  d16


# 353 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  if "ni > 1" {
      "zeta = (taua + pwc*2 - 2u - p51 - d16 - 5u)/(ni - 1)"
    }
   else {
      "zeta = 0.1u"
  }

  if " zeta < 0.1u "
  {
   2u
   print "error: problem with zeta"
   goto HaltAcqu
  }

# 372 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
   "zetacount = trunc(d0/in0 + 0.4)"
   "zeta1 = zeta*zetacount"


if "zeta > in0" {
     "zeta1 = 0.2u"
}
# 382 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
; This is the real start

 (pwh ph10):f1                                 ; H90x

  2u
  p51:gp1                                       ; gradient 1
  d16
# 390 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  "DELTA = taua + d0 - 2.0u - p51 - d16"
   DELTA

  (pwc*2 ph=0.0):f2

  "DELTA = d0 - zeta1"
   DELTA
# 398 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
   (pwh*2 ph=0.0):f1

   "DELTA = taua - zeta1 + pwc*2 - 2u - p51 - d16"
    DELTA

  2u
  p51:gp1                                       ; gradient 1
  d16
# 407 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  (pwh ph=90.0):f1                                  ; H90y


# 412 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  2u pl4:f4
  (pwd ph=90.0):f4
  2u pl41:f4
  (2u ph=0.0):f4
  (2u cpds4 ph=0.0):f4                          ;2H dec ON


 (pwc ph1):f2                                  ; C90(ph1)
# 421 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  2u pl23:f2

  
  (2u cpds5 ph=0.0):f2                            ; CO dec ON (off res seduce)

# 427 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  "DELTA = taub - 2u - 2u - 2u - 4u - pwd - 2u - p52 - d16 - 2u"
   DELTA


# 435 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  2u do:f2                                      ; CO dec off     


  2u do:f4                                      ; 2H dec OFF
  2u pl4:f4
  (pwd ph=270.0):f4
# 443 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  2u
  p52:gp2                                       ; Gradient 2
  d16                                     

  2u pl2:f2                                          ; power for C 180
  (center (pwh*2 ph26):f1 (pwc*2 ph26):f2 )
  2u pl23:f2                                         ; power for CO seduce dec

  2u
  p52:gp2                                             ; gradient 2
  d16
# 456 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  2u pl4:f4
  (pwd ph=90.0):f4
  2u pl41:f4
  (2u ph=0.0):f4
  (2u cpds4 ph=0.0):f4                          ;2H dec ON


  
  (2u cpds5 ph=0.0):f2                            ; CO dec ON (off res seduce)
# 467 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  "DELTA = taub - 2u - 2u - p52 - d16 - 8u - pwd - 2u - 2u - 2u"


# 471 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  DELTA


  2u do:f2                                      ; CO dec off     
# 476 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  2u pl2:f2                                     ; power for C90
  (pwc ph=90.0):f2                                  ; C 90y


# 481 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  2u do:f4                                      ; 2H dec OFF
  2u pl4:f4
  (pwd ph=270.0):f4


if "l10 % 2 == 1" {
    (pwh ph=180.0):f1
}
else {
    "DELTA = pwh"
 DELTA
}
# 494 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  2u
  p53:gp3                                             ; gradient 3
  d16 pl22:f2       


# 500 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  if "ncyc >= 1" 
  {
    "DELTA = pwcdip*94.22*ncyc"
    (DELTA cpds2 ph=0.0):f2                                ; cpds2="flopsy8" on
     2u do:f2                                          ; tocsy off 
   }


 
  2u fq=cnst2:f2                           ; 13C SFO2+cnst2(Hz) @ 58ppm
# 511 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  2u
  p53:gp3                                            ; gradient 3
  d16 pl2:f2                                        ; power for 13C at high power

  "DELTA = 3.4m - 6u - p53 - d16 "
   DELTA

# 520 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
   2u pl12:f1                                       ; power for 1H dec
   (pwmlev ph=90.0):f1                                  ; H90y @ powe pl12
   (2u cpds1 ph=0.0):f1                               ; waltz16x ON


  2u pl4:f4
  (pwd ph=90.0):f4
  2u pl41:f4
  (2u ph=0.0):f4
  (2u cpds4 ph=0.0):f4                          ;2H dec ON
# 532 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
; transfer from 13Ca to 15N 
; use high power 13Ca pulses at 58 ppm

  (pwc ph2):f2                        

# 539 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  
  2u pl27:f2                                         ; power for Cb decoupling
  (2u cpds7 ph=0.0):f2                                 ;  Cb dec ON

  "DELTA = tauc - 2u - 2u - 2u" 
  DELTA

# 547 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  2u do:f2                                            ; Cb dec off


  (pwcreb:sp25 ph26):f2                              ;  43 ppm
  1u
  (pwn*2.0 ph26):f3
# 554 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  2u pl27:f2                                         ; power for Cb decoupling
  (2u cpds7 ph=0.0):f2                                 ;  Cb dec ON

  "DELTA = tauc - 1u - pwn*2.0 - 2u - 2u - 2u - 2u" 
  DELTA

  2u do:f2                                            ; Cb dec off
  2u pl2:f2                                         ; power for Ca 90b
  (pwc ph27):f2                                   ; Ca90y
# 577 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
# 578 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  
  2u do:f1                                           ; 1H dec OFF
  
  (pwmlev ph=270.0):f1                                  ; H90-y at pl12


# 585 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  2u do:f4                                      ; 2H dec OFF
  2u pl4:f4
  (pwd ph=270.0):f4
  2u pl41:f4


  2u
  p54:gp4                                             ; gradient4 
  d16 
# 595 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
; now transfer from 15N to HN for detection with acq of 15N


# 599 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
   2u pl12:f1                                       ; power for 1H dec
   (pwmlev ph=90.0):f1                                  ; H90y @ powe pl12
   (2u cpds1 ph=0.0):f1                               ; waltz16x ON

  
  2u pl26:f2                                  
  (2u cpds6 ph=0.0):f2                        

if "bigTN - d10 > 0.2u" {
# 609 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  (pwn ph7):f3                                  ; N90(PH7)

  "DELTA = bigTN - d10"                         ; dly 1/(4JNCO) - t2/2
  DELTA

# 615 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  2u do:f2                   
  2u pl2:f2                

  (pwn*2 ph8):f3                                ; N180(PH8)
   1u
  (pwc*2.0 ph26):f2     

  
  2u pl26:f2                        
  (2u cpds6 ph=0.0):f2              
# 626 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  "DELTA = bigTN + 2u + 2u - 1u - pwc*2.0 -2u -2u + d10 - 5.5m"   
  DELTA
}
else {
  (pwn ph7):f3                                  ; N90(PH7)
  1u
  (pwn*2 ph8):f3

  "DELTA = d10 - bigTN"            
  DELTA

# 638 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  2u do:f2                 
  2u pl2:f2                 

  (pwc*2.0 ph=0.0):f2     

  
  2u pl26:f2                       
  (2u cpds6 ph=0.0):f2                            ; Ca dec ON (on res seduce)
# 647 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  "DELTA = bigTN + 1u - 2u - 2u - pwc*2.0  -2u -2u + d10 - 5.5m"   
   DELTA
}
0.2u

  
  2u do:f1                                      ; H dec off
  (pwmlev ph=270.0):f1                               ; H90-x at pl12

  "DELTA = 5.5m - 0.2u - 2u - pwmlev - 2u - 2u - 2u - p56 - 1.0m - 2u"
   DELTA
# 659 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  
  2u do:f2                               
  2u pl2:f2                          

  2u
  p56:gp6                      ; gradient6 coherence selection 
  1m
  
  2u pl1:f1                                ; power for pwh

  (center (pwh ph26):f1 (pwn ph9):f3)        ; H90x,N90(ph9)
# 671 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  (pwc ph=0.0):f2

  2u
  p57:gp7                                    ; gradient 7
  d16

  "DELTA = tauf - 2u - pwc - 2.0u - p57 - d16"            ; dly 1/4JNH
  DELTA
 
  (center (pwh*2 ph26):f1 (pwn*2 ph26):f3)   ; H180x,N180x
# 682 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  "DELTA = tauf - 2.0u - p57 - d16"            ; dly 1/4JNH
  DELTA

  2u
  p57:gp7                                    ; gradient 7
  d16

  (center (pwh ph27):f1 (pwn ph29):f3)         ; H90y,N90y
# 691 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  "DELTA = tauf - 2.0u - p58 - d16 - (pwn - pwh)*0.5"            ; dly 1/4JNH
  DELTA

  2u
  p58:gp8                                    ; gradient 8
  d16
 
  (center (pwh*2 ph26):f1 (pwn*2 ph26):f3)   ; H180x,N180x

  2u
  p58:gp8                                    ; gradient 8
  d16
# 704 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  "DELTA = tauf - 2.0u - p58 - d16"            ; dly 1/4JNH
  DELTA

  (pwh ph=0.0):f1                              ; H90x

  "DELTA = bigT1 - pwh*2/PI"
  DELTA                                     ; dly DELTA
# 712 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  (pwh*2 ph=0.0):f1

  2u
  p59:gp9*EA                                    ; gradient 9 coherence selection
  d16                                 

# 719 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  4u ctrlgrad 4047                                ; Blank gradients


# 724 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
  2u pl31:f3

  "DELTA = bigT1 - 2u - p59 - d16 - 4u - 2u - de"
  DELTA                                     ; dly DELTA

  go=2 ph31 cpd3:f3
# 1 "mc_line 730 file /root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp exp. mc cmd. in line"
  MCWRK  do:f3 wr #0 if #0 zd 

  "ph2loop+=1"
      "d0=d0orig + t1loop * in0 "
      "phval10 = (ph1loop % 2) * 90"
      MCWRK ip10 + phval10
      "l10 = l10orig + ph1loop * 1"

      "d10=d10orig + t2loop * in10 "
      "phval9 = (ph2loop % 2) * 180"
      MCWRK ip9 + phval9
      "phval7 = (t2loop * 180)%360"
      MCWRK ip7 + phval7
      "phval31 = (t2loop * 180)%360"
      MCWRK ip31 + phval31
      MCWRK
      "phval0 = ph2loop * 1"
      MCWRK setgrad EA
  lo to LBLF2 times 2
  MCWRK 

  "t2loop+=1"
      "d0=d0orig + t1loop * in0 "
      "phval10 = (ph1loop % 2) * 90"
      MCWRK ip10 + phval10
      "l10 = l10orig + ph1loop * 1"

      "d10=d10orig + t2loop * in10 "
      "phval9 = (ph2loop % 2) * 180"
      MCWRK ip9 + phval9
      "phval7 = (t2loop * 180)%360"
      MCWRK ip7 + phval7
      "phval31 = (t2loop * 180)%360"
      MCWRK ip31 + phval31
      MCWRK
      "phval0 = ph2loop * 1"
      MCWRK setgrad EA
  lo to LBLST2 times ST2CNT
  MCWRK 
  "t2loop=0"
  "ph2loop=0"
  MCWRK 

  "ph1loop+=1"
      "d0=d0orig + t1loop * in0 "
      "phval10 = (ph1loop % 2) * 90"
      MCWRK ip10 + phval10
      "l10 = l10orig + ph1loop * 1"

      "d10=d10orig + t2loop * in10 "
      "phval9 = (ph2loop % 2) * 180"
      MCWRK ip9 + phval9
      "phval7 = (t2loop * 180)%360"
      MCWRK ip7 + phval7
      "phval31 = (t2loop * 180)%360"
      MCWRK ip31 + phval31
      MCWRK
      "phval0 = ph2loop * 1"
      MCWRK setgrad EA
  lo to LBLF1 times 2
  MCWRK 

  "t1loop+=1"
      "d0=d0orig + t1loop * in0 "
      "phval10 = (ph1loop % 2) * 90"
      MCWRK ip10 + phval10
      "l10 = l10orig + ph1loop * 1"

      "d10=d10orig + t2loop * in10 "
      "phval9 = (ph2loop % 2) * 180"
      MCWRK ip9 + phval9
      "phval7 = (t2loop * 180)%360"
      MCWRK ip7 + phval7
      "phval31 = (t2loop * 180)%360"
      MCWRK ip31 + phval31
      MCWRK
      "phval0 = ph2loop * 1"
      MCWRK setgrad EA
  lo to LBLST1 times ST1CNT
  MCWRK 
  "t1loop=0"
  "ph1loop=0"
  MCWRK rf #0
  lo to LBLAV times tdav
# 733 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
# 735 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
d11 h2lock         ;SEL_2H plus interleave_incr
d11 setrtp0^0
; d11 


HaltAcqu, 1m
exit
# 743 "/root/.topspin-BladeEpu/local_acqu/simulDirs/ppDirs/hcctocsy_CA_nnh_pfg_lek_600_cp"
ph1=0 2      
ph2=0         
ph7=0 0 2 2
ph8=0 0 0 0 2 2 2 2
ph9=0
ph10=0
ph31=0 2 2 0
ph26=0
ph27=1
ph28=2
ph29=3

;cnst2 : (58-43)ppm offset in Hz
;pl1 : tpwr - power level for pwh
;pl10 : tsatpwr - power level for 1H presat
;pl12 : tpwrml - power level for 1H waltz16
;pl2 : dhpwr - power level for C high power 90 and 180
;pl21 : dpwr - low power level for C (dec)
;pl22 : dpwrdip - power level for C tocsy
;pl23 : dpwrcodec - power level for CO seduce decoupling t1
;pl25 : power level for C reb ~ <=350 u centered at 43 ppm
;pl26 : CO decoupling 15N magnetization -  t2
;pl27 : dpwrcbdec - power level for sel Cb decoupling
;pl3 : dhpwr2 - power level for pwn
;pl31 : dpwr2 - power level for 15N cpd
;pl4  : power level for 2H pulses
;pl41 : power level for 2H decoupling
;sp25 : power level for reburp
;p1 : pwh
;p12 : pwmlev - 1H 90 for waltz16dec at power pl12
;p2 : pwc
;p22 : pwcdip - 13C 90 at pl22 for C tocsy about 30 ms
;p23 : pwCOdec - pattern length us @ spw23 during t1
;p25 : pwcreb
;p26 : pattern length for decoupling of CO during 15N t2
;p27 : pwCbdec - pattern length us @ spw27
;p3 : pwn
;p31 : pwn at dpwr2 for decoupling
;p4 : 2H high power pulse, 90
;p41 : 2H decoupling
;d1 : relaxation delay
;d11 : delay for disk i/o, 30ms
;d16 : gradient recovery delay, 200us
;d14 : bigT1, 650 us
;d20 : taua, H to C, 1.8ms
;d21 : taub, refocus JHC for 13C mag
;d22 : tauc,  Ca to N transfer ~ 13 ms unless Cb dec
;d25 : bigTN, t2 evolv, N-CO refocus, 12.4 ms
;d26 : tauf, 1/4JNH, ~ 2.4 ms
;d30 : dummy variable - do not adjust
;cpds1: 1H decoupling according to program defined by cpdprg1 (waltz16)
;cpds2: C decoupling for tocsy according to program defined by cpdprg2 (flopsy8)
;cpd3 : 15N decoupling according to program defined by cpdprg3 (waltz16)
;cpds4 : 2H decoupling according to program defined by cpdprg4 (waltz16)
;cpds5: CO decoupling t1 according to program defined by cpdprg5 (onepulse.sp23 off res seduce)
;cpds6: CO decoupling t2 according to program defined by cpdprg6 (onepulse.sp26)
;cpds7: Cb decoupling according to program defined by cpdprg7 (wurst2)
;pcpd3: 1/dmf2 - 90 degree pulse for cpd3
;l7 : ncyc, number of times flopsy is repeated; total_time = pwcdip*94.22*ncyc
;spnam23 : File name for CO decoupling sitting at 43 ppm t1
;spnam26 : File name for CO decoupling during 15N t2
;spnam27 : File name for Cb decoupling during Ca to N transfer
;cpdprg2 : flopsy transfer
;cpdprg5 : CO decoupling while sit at 43 ppm
;cpdprg6 : CO decoupling while carbon carrier at 58 ppm (mag is 15N)
;cpdprg7 : Cb decoupling while sit at 58 ppm
;zgoptns : Df1180,Df2180,DDdec, DoneDarray,DCbdec 

